A former Securities and Exchange Commission official has agreed to pay a $50,000 fine for going through the revolving door and working for alleged Ponzi scheme mastermind Robert Allen Stanford after purportedly taking part in SEC decisions to not investigate Stanford, the Justice Department said Friday.

Spencer C. Barasch, a lawyer who was head of enforcement in the SEC’s Fort Worth regional office, left the SEC in 2005 and went on to represent Stanford Financial Group briefly in an agency investigation, according to a March 2010 report by the SEC inspector general.

In testimony to the inspector general’s office, Barasch gave this explanation, the report said: “Every lawyer in Texas and beyond is going to get rich over this case. Okay? And I hated being on the sidelines.”

That was after Barasch participated in SEC decisions — going back to 1998 — to not pursue warnings that Stanford’s business might be conducting an investment fraud, according to the inspector general’s report.

Barasch directed the closing of a preliminary investigation of Stanford in 1998, declined an SEC staff recommendation to investigate Stanford Financial Group in 2002 and declined to open a probe of the firm in 2003, the Justice Department said.

The Justice Department accused Barasch of violating a federal ethics law that makes it illegal for former federal officials to represent clients before their former agencies on matters in which they participated “personally and substantially” while working for the government, the inspector general’s office said in a news release Friday.

Barasch has denied any wrongdoing, the Justice Department said.

“At no time has he compromised his honor or ethics, and we vigorously dispute any suggestion to the contrary,” Paul Coggins, a lawyer for Barasch, said in a statement.

Barasch agreed to the settlement “to avoid the expense and uncertainty of protracted litigation,” Coggins said.

Under the civil settlement, Barasch agreed to pay the maximum fine for a violation of the statute, the Justice Department said.

“Today’s settlement demonstrates that we will hold those that shirk their professional responsibilities accountable for their conduct,” Texas U.S. Attorney John M. Bales said in a statement Friday.

“This misconduct highlights the dangers of a ‘revolving door’ environment between the SEC and the private securities law bar,” SEC Inspector General H. David Kotz said in a statement Friday.

The Justice Department’s agreement with Barasch was negotiated weeks ago but was kept on hold to give the SEC a chance to announce disciplinary action against Barasch at the same time, a person familiar with the matter said. The SEC, which has the authority to bar professionals from practicing before the agency, has not announced any disciplinary action.

A second person familiar with the matter said that SEC commissioners on Thursday considered and rejected a settlement Barasch had reached with the SEC’s staff that would have barred him from practicing before the agency for six months.

Both spoke on the condition of anonymity to discuss what happened behind closed doors.

“We’re still working on a resolution with the SEC,” Coggins said.

Barasch “played a significant role in multiple decisions over the years to quash investigations of Stanford,” the report said.

Barasch figured prominently in the March 2010 report examining the agency’s failure to stop Stanford despite repeated warnings over more than a decade.

The case highlights the revolving door between the SEC and law firms that defend people under investigation by the agency. It also involves one of the SEC’s biggest lapses.

In early 2009, after the collapse of Bernard Madoff’s massive investment fraud put Ponzi schemes in the spotlight, the SEC charged Stanford and his companies with operating an $8 billion fraud. The scheme allegedly involved false promises of guaranteed returns on certificates of deposit issued by a bank in Antigua. The Justice Department announced parallel criminal charges.

Stanford has been defending himself in the cases and is to go on trial Jan. 23.

The SEC has been under political pressure to help investors who put their trust in Stanford. In December, the SEC filed a lawsuit in federal court seeking to compel an investor protection fund bankrolled by the brokerage industry to backstop at least some of the investors’ losses.

As with Madoff’s epic Ponzi scheme, the SEC missed numerous chances to go after Stanford. But in Stanford’s case, some of the warnings were coming from the SEC’s staff. As early as 1997, a routine SEC examination of Stanford’s brokerage firm flagged potential misrepresentations to investors. In an internal agency tracking system, the business was described as a “possible Ponzi scheme,” the inspector general’s report said.

After leaving the agency, Barasch made three attempts to represent Stanford in connection with an SEC investigation of his new employer, the inspector general reported. Barasch initially e-mailed an SEC ethics official, saying he was “not aware of any conflicts” that would preclude his defense work, the inspector general reported.

Going through the revolving door is not ordinarily a crime, but various federal restrictions apply. The SEC ethics official determined in 2005 that Barasch was barred from representing Stanford, the inspector general reported. Nonetheless, the following year, Stanford retained Barasch to represent him in the probe, the report said.

After he had already performed legal work for Stanford, Barasch for a second time sought SEC approval to represent Stanford and was again told he could not do so, the inspector general reported.

“I needed the work. But I wanted it to be ethical work,” Barasch later told the inspector general’s office.

After the SEC sued Stanford for fraud in 2009, Barasch again sought to represent him, the inspector general reported.

Barasch told the inspector general’s office that he decided to close an inquiry into Stanford in 1998 and refer the matter to the NationalAssociation of Securities Dealers, a self-regulatory group for the brokerage industry.

Julie Preuitt, an SEC official who had been examining Stanford’s business, testified that she reacted to Barasch’s decision with “shock and disbelief and this incredible feeling of failure and great disappointment.”

SEC examiners “dutifully conducted examinations of Stanford in 1997, 1998, 2002 and 2004, concluding in each case that Stanford’s CDs were likely a Ponzi scheme or a similar fraudulent scheme,” the inspector general’s report said.

“While the Fort Worth examination group made multiple efforts after each examination to convince the Fort Worth enforcement program . . . to open and conduct an investigation of Stanford, no meaningful effort was made by enforcement to investigate the potential fraud or to bring an action to attempt to stop it until late 2005,” after Barasch left the agency, the inspector general said.

Then, the SEC dropped the ball again, the report said. The only evidence of any investigative action taken in connection with the 1998 Stanford inquiry “was a voluntary request for documents” that the SEC sent to Stanford, the report said. After Stanford refused to produce documents, no further investigative steps were taken, the report said.

A former enforcement official, Hugh Wright, testified that officials “thought it was a Ponzi scheme” but didn’t think they had enough facts to get the SEC’s leadership to authorize the use of a subpoena, according to the report.

The enforcement staff’s main reservation about pursuing a Stanford probe in 1998 was a perceived “lack of U.S. investors” with a stake in the matter, SEC officials told the inspector general.

Barasch told the inspector general’s staff that another factor in his decision not to pursue investigations was that Stanford’s certificates of deposit were issued by a foreign bank, according to the report. At the time, the SEC wanted to focus on cases of accounting fraud rather than Ponzi schemes, and the staff was under pressure to pursue “quick hit” cases that would boost its enforcement statistics, the inspector general reported.

The firm’s Web site says Barasch is the leader of its corporate governance and securities enforcement team, and that he has extensive experience defending clients in cases initiated by the SEC and other authorities.

“Prior to joining Andrews Kurth as a partner, Spence spent 17 years with the SEC during which time he served in a variety of capacities, including director for the SEC’s enforcement program in the Southwest,” the site says. “While at the SEC, Spence directed high-profile investigations and litigation in all areas of the securities industry, often working closely with the DOJ and state and self regulatory organizations,” the site says.

A study issued in May by the independent watchdog Project on Government Oversight (POGO) found that over a five-year period, 219 former SEC employees filed almost 800 disclosures saying they planned to represent clients or employers in dealings with the agency.

The disclosures that POGO obtained through the Freedom of Information Act offered just a glimpse of the interaction between SEC alumni and the agency where they once worked, because former employees are required to make such disclosures only during the first two years after they leave the SEC.