Back when former Goldman Sachs director Rajat Gupta’s most pressing problem was the Securities and Exchange Commission’s civil case against him, his defense scored a small victory when the SEC agreed to drop an administrative proceeding against him and brought civil charges in federal court instead. Gupta’s lawyer, Gary Naftalis of Kramer Levin Naftalis & Frankel, had fought to have Gupta’s case heard by a federal judge, rather than an SEC administrative law judge, because the rules of evidence in administrative proceedings favor the agency. Among other things, the SEC can admit hearsay evidence, and defendants don’t have the same rights to depose opposing witnesses. Although the SEC can’t seek the same penalties in administrative proceedings as it can in federal court, they can be an effective way for the agency to make a statement about improper conduct.

Except when the defendants win.

On Friday, the SEC’s chief administrative law judge, Brenda Murray, entered a painstaking 58-page decision that cleared former State Street executives John Flannery and James Hopkins on all of the SEC’s sprawling allegations that they misled investors about the mortgage-backed securities holdings in State Street bond funds. Murray found that the agency failed to show at trial that Flannery and Hopkins violated any securities laws in communicating with investors about the funds’ subprime MBS holdings. She went out of her way to describe the former State Street execs as candid, believable witnesses who were frustrated to be on trial.

Murray’s ruling is yet another courtroom rebuke to the SEC, which in the last few years has seen several high-profile trials end in victory for defendants. Most notably, in 2009 a San Francisco federal judge dismissed stock options backdating charges against Broadcom executives; and in 2010 a Manhattan federal judge exonerated two traders in a landmark SEC case alleging insider trading in credit-default swaps. The State Street loss is perhaps an even bigger black eye for the SEC, given that the loss came in an administrative proceeding, the agency’s home turf.

“This is a case where the SEC should never have proceeded against my client,” said Mark Pearlstein of McDermott Will & Emery, who represented former State Street Americas chief investment officer Flannery. “We felt all along that if we received a fair hearing we would prevail. Chief judge Murray gave us a very fair hearing.”

Hopkins, who was a former head of project engineering for State Street, was represented by John Sylvia of Mintz Levin. “We and our client are thrilled,” Sylvia said. “We’ve maintained from the outset that this is a case that never should have been brought.”