Were it not for the missing customer funds, the collapse of MF Global would be hailed as an example of how well the financial system worked.

That’s a very big “if,” of course, and the loss of customer funds is a scandal all its own.  But the market worked – and that’s an important lesson.

The accountants, the regulators and the board of directors did their part – not perfectly and perhaps not quickly – but they asked the right questions, demanded disclosure of the firm’s trades and forced management to defend its strategy.  Customers, shareholders and counterparties then concluded MF Global had too much risk and abandoned the firm – exactly the sort of rough justice that’s at the core capitalism.

Let;s start with the MF Global board, which, unlike Bear Stearns and Lehman Brothers, had directors who were financially sophisticated.  The board questioned the risk of MF Global’s European debt trades in what sounds like a heated exchange with CEO Jon Corzine.  The board may have erred in its judgment that Corzine’s trades were prudent, but it did its job by asking tough questions about risk.

The regulators, too, did their part.  Led by FINRA, they raised the alarm, and stood firm as Corzine fought to convince them MF Global needed less added capital than the regulators were demanding.  Even the firm’s auditors forced a disclosure of the trades, albeit belatedly.  Here’s how the New York Times described the events:

Eventually, MF Global’s auditor, PricewaterhouseCoopers, asked Mr. Corzine to report the European debt exposure to his investors. He personally met with the accounting firm in December 2010, two people said, and it was agreed that the transactions would be mentioned in a footnote in the firm’s annual report, which was filed on May 20, 2011.

Earlier, one of MF Global’s many regulators noticed something curious. The Financial Industry Regulatory Authority, which helped watch over MF Global’s securities business, noticed a sharp swing in profits in a monthly report the firm filed to regulators. Finra asked MF Global executives about the volatile accounting line but did not get a satisfactory answer, say people familiar with the matter, until the annual report came out weeks later.

When Finra realized what MF Global was doing, it grew concerned. The Wall Street self-regulator told MF Global to set aside enough money in case the trades went bad. But Finra didn’t have the authority to force the firm to do so — that power was in the hands of the Securities and Exchange Commission, whose rule Finra was citing.

Mr. Corzine then personally took the firm’s case to the S.E.C. in mid-August, taking the Delta Shuttle to Washington for a meeting with a top agency official.

The S.E.C. indicated it would side with Finra, but needed a few weeks to make a final determination. In the meantime, MF Global and Finra haggled over the size of the capital cushion: the regulator wanted $200 million set aside, while the firm pushed for a figure closer to $50 million. In late August, Finra won out.

It would be the beginning of the end for MF Global.

As the facts come to light, we’ll see major mistakes in the way MF Global handled its risk reporting and client accounts.  But for exerting discipline where risk-taking is concerned, the system worked.