In effect, the bankers had siphoned off this bailout money in advance, years before the government had spent it.

I understand this chain of events sounds a bit like a conspiracy. And in some cases, it surely was. Some A.I.G. employees, to take one example, had to have understood what their credit derivative division in London was doing. But more innocent optimism probably played a role, too. The human mind has a tremendous ability to rationalize, and the possibility of making millions of dollars invites some hard-core rationalization.

Either way, the bottom line is the same: given an incentive to loot, Wall Street did so. “If you think of the financial system as a whole,” Mr. Romer said, “it actually has an incentive to trigger the rare occasions in which tens or hundreds of billions of dollars come flowing out of the Treasury.”

Unfortunately, we can’t very well stop the flow of that money now. The bankers have already walked away with their profits (though many more of them deserve a subpoena to a Congressional hearing room). Allowing A.I.G. to collapse, out of spite, could cause a financial shock bigger than the one that followed the collapse of Lehman Brothers. Modern economies can’t function without credit, which means the financial system needs to be bailed out.

But the future also requires the kind of overhaul that Mr. Bernanke has begun to sketch out. Firms will have to be monitored much more seriously than they were during the Greenspan era. They can’t be allowed to shop around for the regulatory agency that least understands what they’re doing. The biggest Wall Street paydays should be held in escrow until it’s clear they weren’t based on fictional profits.

Above all, as Mr. Romer says, the federal government needs the power and the will to take over a firm as soon as its potential losses exceed its assets. Anything short of that is an invitation to loot.

Mr. Bernanke actually took a step in this direction on Tuesday. He said the government “needs improved tools to allow the orderly resolution of a systemically important nonbank financial firm.” In layman’s terms, he was asking for a clearer legal path to nationalization.