U.S. Treasury Secretary Tim Geithner is calling it a day. So is Treasury’s Troubled Asset Relief Program, the $418 billion effort to rescue banks, automakers and other companies during the financial crisis.

In announcing its intention to complete the sale of the remaining shares it owned in General Motors Co., American International Group Inc. and 218 smaller banks, Treasury is essentially ending a controversial bailout that kept the financial system from collapse at a cost far less than many imagined in the darkest days of 2008.

Most banks are healthy again, backed by billions more in capital. The U.S. auto industry is thriving. Even AIG has shed the assets that almost sank the global financial system. The ultimate price tag is expected to be between $24 billion and $60 billion, or less than 1 percent of gross domestic product and far less than previous financial catastrophes.

Yet for all its success, TARP was by no means perfect. It was too generous to the companies it aided. It exacerbated the problem of moral hazard. And it did too little to help average Americans weather the housing meltdown at the root of the financial crisis.

Financial Stabilizer

TARP’s main purpose was to stabilize the financial system by injecting capital into more than 700 banks and other companies whose collapse had the potential to wreak havoc on the U.S. economy. The 19 largest banks were forced to undergo stress tests and add to capital levels so they could absorb losses through a steep recession. In return, the U.S. received preferred shares, debt and warrants in the institutions. Most of these have been redeemed or repaid. Treasury has recovered about $375 billion of the $418 billion it disbursed.

It’s worth pointing out, though, that Treasury’s returns could have been greater. The department dictated almost identical terms for all institutions in its main capital program, regardless of health or taxpayer risk. The rationale was that labeling a bank as weak could trigger a run, yet the financial markets clearly knew which companies were on stronger footing.

The result was that healthy institutions, including Goldman Sachs Group Inc. and JPMorgan Chase & Co., paid Treasury a 5 percent annual dividend on their preferred shares, the same rate as weaker institutions. Five percent was probably too low: Billionaire investor Warren Buffett squeezed a 10 percent coupon out of Goldman Sachs when he agreed to invest $5 billion during the crisis, a move that netted the Berkshire Hathaway chairman a $3.7 billion profit, according to Bloomberg News. Treasury’s $10 billion Goldman investment generated about $1.1 billion.

Then there’s the question of moral hazard. By ensuring that creditors, along with depositors, were paid in full, the U.S. fueled the market’s expectation of future government interventions.

The Dodd-Frank financial law tried to counteract this impression by banning taxpayer-funded bailouts and creating a system to wind down failing firms. Wall Street doesn’t believe it: Too-big-to-fail banks can still borrow more cheaply than smaller banks, according to Federal Deposit Insurance Corp. data. Economists at the New York Federal Reserve also found that banks made dodgier loans as a result of getting government support.

Finally, TARP fell short on housing. The government’s two main programs have helped fewer than 3 million troubled homeowners, far below the 9 million goal outlined by the Barack Obama administration. Although the housing market is finally recovering, it has little to do with TARP assistance.

Valuable Lessons

Yes, TARP should be cut some slack. It was an emergency rescue plan cobbled together at a time of panic. But its weaknesses offer valuable lessons for lawmakers and regulators, who are grappling with what, if anything, to do about moral hazard and too-big-to-fail banks.

A few approaches come to mind: asking the largest banks to hold more capital, restricting the amount of proprietary trading they can do and capping the size of their non-deposit liabilities, such as overnight repurchase agreements. Future rescues should also provide more help to distressed homeowners, with more emphasis on reducing mortgage principal and less on lowering monthly payments. Only then will the public’s antipathy toward bailouts -- and the perception that they benefited Wall Street over Main Street -- fade.

It would be a shame to say goodbye to TARP without learning from it.

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