H. David Kotz knows what it’s like to have all conversation stop the moment he steps into a crowded elevator at work — and resume the moment he exits.

But the inspector general of the U.S. Securities and Exchange Commission isn’t much concerned with being popular. He said he’s far more interested in “rolling up my sleeves in a matter and trying to figure out what happened.”

His investigations range from minor issues (an employee who yells and curses at colleagues) to colossal scandals (Bernard Madoff’s $65 billion fraud) to just plain embarrassing (workplace porn anyone?). “The primary role I have is to ensure the agency is able to perform its mission in an effective and efficient manner,” said Kotz, 44, in a lengthy interview in his second-floor office in a far corner of SEC headquarters overlooking a parking lot. With a tight-knit staff of 22, Kotz conducts audits and investigations that touch every aspect of agency operations. Since joining the SEC in late 2007, he’s produced explosive reports that have documented SEC shortcomings in painful detail — and led directly to major internal reforms.

“When he got to [the SEC], it was a mess. It’s a totally different agency now, in large part because of his efforts,” said whistleblower Harry Markopolos, who tried without success to alert the SEC to Madoff’s Ponzi scheme for nearly a decade. “I had lost my faith in government. But he was unflagging. Nothing deterred him or his team. He restored my faith.”

Kotz’s scrutiny of the SEC remains relentless. In a 109-page semiannual report sent to Congress last week, he uncovered dozens of new mistakes and problems. For example, a regional staff attorney disclosed the name of a confidential FBI informant to an investor and witness, and revealed that the informant was secretly taping conversations.

In another instance, an employee at SEC headquarters provided “false, misleading and nonpublic information to investors about an active enforcement investigation and litigation.” The employee was an investor in the company, which the report doesn’t name — but the dates cited match the SEC’s case against Imperia Invest IBC. The company, an alleged Ponzi scheme, targeted deaf investors. The SEC won a court order for millions in disgorgement in February.

Kotz’s report also details widespread problems, like granting contractors access to SEC buildings and computer systems before their background investigations are complete. And it flags an ongoing investigation into the SEC’s $557 million lease for 900,000 square feet of unneeded office space in downtown Washington.

On a more personal — and mortifying — note, the report found SEC lawyers and accountants are still using their office computers to view pornography during work hours, despite a much-publicized prior report from Kotz about the practice. One lawyer received hundreds of “access request denials” for Web sites classified as pornographic, but still managed to view dirty images on his SEC computer. He subsequently quit. Another lawyer looked at numerous photos of partially or fully nude women at work and is being fired.

But Covington & Burling securities practice co-head David Martin wonders if “you couldn’t go into any organization in the country, any corporation or government agency,” and find similar behavior. “I’m not condoning it, but don’t see that the case has been made that the SEC is much different than the rest of the world in this respect,” he said.

Martin, who formerly headed the SEC’s Division of Corporation Finance but does not know Kotz personally, said the inspector general’s high-profile approach to his job “could strengthen the SEC if it makes everyone careful about what they do.” But there is a balance to be struck, he cautioned, “A little fear is good, but too much is a bad thing.”

PEACE CORPS’ COP

Kotz earned his J.D. from Cornell Law School in 1990 (according to the framed diploma on his wall, his first initial, H, stands for Harold), and is married to Boston Globe health reporter Deborah Kotz. They have three children. Kotz prides himself on never missing a parent-teacher conference — he’s even found time over the years to coach Little League and soccer teams.

He began his legal career in private practice, working for now-defunct Graham & James, then Stults & Balber and Pepper Hamilton, where he was a litigator. In 1999, he moved to the U.S. Agency for International Development and became inspector general of the Peace Corps in 2006.

At the Peace Corps, much of his work focused on the safety and security of the overseas volunteers. When then-Chairman Christopher Cox hired him as SEC inspector general in 2007, he recalled, “The reaction from many people was, ‘Well, this is very different from the Peace Corps; you’re going to have to get up to speed on securities issues.’ ”

“I remember the chairman and the chief of staff gave me these very, very large books with all kinds of analysis on securities regulation,” he said. “And then the first three or four investigations that I worked on at the SEC were identical to ones I worked on at the Peace Corps — procurement fraud, inappropriate use of the computer, things like that.”

But he soon found himself in the thick of the securities world with the collapse of Bear Stearns Cos. in March 2008. His first major report, released six months later, looked at the SEC’s role in overseeing the investment bank. “It is undisputable that [the SEC] failed to carry out its mission in its oversight of Bear Steams,” the report stated. There were “numerous potential red flags prior to Bear Stearns’ collapse.”

Bear Stearns was followed by the Lehman Brothers’ bankruptcy and the emergency sale of Merrill Lynch. But for Kotz, nothing compared to the call from Cox to investigate how the SEC, despite receiving six substantive complaints, failed to detect that Madoff defrauded thousands of clients out of billions of dollars.

After nine months of near round-the-clock work, Kotz and his team produced a 477-page document that whistleblower Markopolos called “the most unbelievable report produced by an inspector general in the history of government. He told the truth. Every system of checks and balances failed.”

Kotz recalled, “It was a massive undertaking. There was a lot of pressure from Congress to get it done in a timely manner. But we also needed to make sure that, after the report was issued, questions didn’t linger.”

In the course of the investigation, Kotz, almost on a whim, decided to request an interview with Madoff himself. He figured, “Who better than Bernie Madoff to find out how Bernie Madoff misled the SEC?” he said. “Initially, I didn’t think he would talk to me.” Madoff had not yet been sentenced, and was not cooperating with the government.

To Kotz’s surprise, Madoff agreed, and on June 17, 2009, Kotz and Deputy Inspector General Noelle Frangipane interviewed Madoff at the Metropolitan Correctional Center in New York City. The disgraced financier was led out in leg irons, and spoke with Kotz for nearly four hours. “He was very forthcoming. He didn’t hold back or refuse to answer any questions,” Kotz said. “He was very concerned about his reputation…but he did not express a lot of remorse for victims.”

Kotz came away with some insights into Madoff’s character. “I asked him, ‘Did you provide the SEC with any false documents?’ He said ‘No. In fact, the documents I provided to the SEC were exactly the ones I provided to my customers.’ I said ‘OK, but weren’t both of them false?’ He said ‘No.’

“I said, ‘All right, let me try again. Didn’t the documents that you provided to the SEC reflect trades that didn’t occur?’ So he thought for about 30 seconds and said, ‘Yeah, I guess I can see how you might view them as false.’ ”

“I think his psychology was he almost believed he wasn’t perpetrating a fraud,” Kotz said. “I think that’s why he was so effective.”

Kotz made more than 90 specific recommendations to the SEC to better detect fraud in the future, such as ­establishing formal guidance for evaluating complaints, improving how complaints are handled and tracked, making sure at least one person on an investigative team has specific experience with the subject matter and training staff to understand what types of information need to be validated. The SEC has implemented every one of his recommendations, which Kotz called “very gratifying.”

Could a Madoff-style swindle happen again? “No one can predict the future,” he said. “I do believe the SEC has put into place new policies and procedures, new systems that will make it less likely.…I feel like our office has done what it can.”

Jenna Greene can be contacted at jgreene@alm.com.