U.S. District Judge Jed Rakoff intimated last month that he wasn’t happy with the Securities and Exchange Commission’s proposed settlement with Citigroup Inc. over the creation and sale of a security that cost investors $700 million.

Yesterday, Rakoff made it official: The proposed $285 million penalty seemed disproportionately small when compared with the losses, Rakoff ruled, and would keep secret crucial details of the risky instrument Citigroup was selling. What’s more, he said, the proposed settlement didn’t serve the public interest because it didn’t do anything to restore faith in the financial markets. The judge ordered Citigroup and the SEC to prepare for a trial in July.

It may never come to that. The SEC and Citigroup will surely try to work out another agreement. But Rakoff still made the right call, and he should stick by it unless the SEC comes back with a much-improved deal.

A little history: In 2007, just as the housing market was about to crash, Citigroup cooked up a $1 billion collateralized debt obligation known as Class V Funding III. This mind-numbing concoction included other CDOs based on subprime mortgages. Once Citigroup sold it to investors, the bank bet against it and made a profit of at least $160 million. According to the SEC, the CDO was designed to fail.

In his ruling, Rakoff offered a point of comparison in CDO shenanigans. He said that Goldman Sachs Group Inc. paid $535 million to settle SEC allegations that it created a self-destructing CDO for the benefit of a client, hedge-fund manager John Paulson. Goldman’s failing, the SEC said, was in not telling buyers who lost money that Paulson had a hand in picking the securities that went into the CDO.

In Rakoff’s view, Goldman paid a proportionally bigger penalty than Citigroup, considering that Goldman’s $15 million profit was less than a tenth of Citigroup’s haul. The SEC responded that Goldman had acted with scienter, or intent to commit securities fraud. Similar intentions were absent in the actions of Citigroup, which was merely negligent, the SEC said.

Which makes us wonder: Was the SEC even reading its lawsuit against Citigroup? Unlike Goldman, Citigroup wasn’t doing the traditional work of an investment bank by serving a client; the bank created a toxic security merely to trade against it, believing an implosion was imminent. Goldman, Rakoff said, admitted that it erred in not telling buyers of Paulson’s role and agreed that employees would cooperate with the SEC and offer testimony in court, if needed. Citigroup made no comparable concessions.

It’s possible the SEC was trying to go easy on Citigroup because it’s big and fragile. Citigroup needed multiple infusions of federal bailout money after the 2008 financial crisis. If the SEC’s intent was to protect the bank, then it’s misguided. Too big to fail should never mean too big to punish.

The SEC can’t have been surprised at Rakoff’s action. In a statement, Enforcement Director Robert Khuzami said the agency was reviewing the ruling and will “take those steps that best serve the interests of investors.”

Those steps should lead to a settlement in which Citigroup admits wrongdoing and pays a penalty commensurate with investor losses and harm done to markets. Otherwise, both sides are probably in for a long march to Judge Rakoff’s courtroom next summer.

To contact the Bloomberg View editorial board: view@bloomberg.net.