Nine state attorneys general have just asked President Obama to fire Edward DeMarco, acting head of the Federal Housing Finance Agency, which oversees Fannie Mae and Freddie Mac. They say: "FHFA's refusal to adjust its policies to allow for principal forgiveness and forbearance stands as a major impediment to addressing the foreclosure crisis."

This isn't a new accusation. Commentators such as Felix Salmon and Paul Krugman have been calling for DeMarco's removal for quite a while. Gretchen Morgenson has defended him: He's just doing his job, she says.

DeMarco's position on principal reduction is mistaken, but he shouldn't be made a scapegoat for all that's gone wrong with the administration's policies on housing. Blame that larger failure on Treasury Secretary Tim Geithner and the president himself.

DeMarco's critics are right that principal reductions for underwater borrowers -- those who owe more than the value of their house -- would help even now to revive the housing market by reducing defaults and relieving the downward pressure on house prices from foreclosures. They would have helped even more before 2009, when the downturn was at its most severe, as John Geanakoplos and Susan Koniak explained.

Avoiding foreclosures is crucial. Nothing suppresses home values like squatters and drug dealers moving in next door as homes are abandoned. Foreclosures also increase the supply of houses for sale. Atif Mian, Amir Sufi, and Franceso Trebbi found they were responsible for 20 percent to 30 percent of the decline in house prices from 2007 and 2009. Foreclosures drive down prices, which puts more borrowers underwater, which increases foreclosures, which drives down prices, and so on.

This vicious circle slowed the recovery after 2009 and is still doing so. The foreclosure rate has lately declined -- thanks partly to lawsuits over fraudulent documentation -- but new notices are still being sent out at a rate more than 125 percent higher than in 2005. House prices, the main component of middle class-wealth, are still nearly 30 percent below their peak in mid-2006. Housing construction has rebounded, but it's still slow by historical standards. There's still a role for principal reduction.

DeMarco says he has to stay within the limits of his authority, and he's looking out for taxpayers. His agency's own analysis cast doubt on the second point, but DeMarco discounts that finding because of concern that other borrowers would be encouraged to default. Many other experts, including Sheila Bair, former chairman of the Federal Deposit Insurance Corp., understand moral hazard but believe principal write-downs are worth the risk.

This focus on DeMarco, though, distracts attention from a bigger issue -- the government's failure to address problems created by the structure of the housing-finance market. There are two important questions: Why couldn't borrowers and lenders come to mutually beneficial deals to write down loans, and why were the government's efforts so unhelpful?

In the days before widespread securitization, banks kept most mortgages on their balance sheets. This encouraged them to work with their borrowers to avoid default -- by lengthening the period of repayment, reducing the interest rate and lowering the amount of principal owed. What bank wants to get stuck with a house that must be rented out or sold at a steep discount?

Securitization changed all that. Loans were divided into tranches, and the tranches were sold in bundles to multiple investors. Modifying loans became far more complicated, and different investors had widely varying interests in the outcome. Perversely, some even preferred foreclosures to principal modifications.

Banks originating and then selling the mortgages typically held onto the second liens (such as home-equity loans). These loans would be entirely wiped out in any principal modification. Banks also own "servicers," companies that collect payments from borrowers and distribute them to investors. These are paid a fixed percentage of principal outstanding, so modifications cut their income. Also, servicers like foreclosures, as Neil Barofsky, the former Special Inspector General of TARP, explained in Bailout:

When a home is sold in foreclosure, [servicers] are typically paid all of their fees and advance expenses before the owners of the mortgages get any of the proceeds of the sale. As a result, though there is a good chance that investors will lose a significant amount of money in the foreclosure of a home, the servicers are in a much better position to recoup their fees and expenses. . . . Though it may be better for an investor if a mortgage is modified, the servicer may be better off if a home goes into foreclosure.

Fannie Mae and Freddie Mac bought more than one-third of all the toxic "private-label" mortgage securities issued during the go-go years. This gave the government a chance to put a stop to "tranche warfare" by coordinating investors and encouraging deals that best served everyone's interests. The chance was missed, not because DeMarco stepped in but because nobody with sufficient authority thought the idea worth pursuing.

The government could also have used TARP money to buy mortgages directly and modify them on its own terms. Several insider accounts say TARP got the approval of Democrats in Congress only because of promises that the money would be used for this purpose. Top Republican economists have advocated spending large sums on mortgage write-downs. So a bipartisan plan wasn't impossible. TARP had money left over after the capital injections and liquidity guarantees for the banks.

The Obama administration did set up some loan-modification schemes, including the Home Affordable Modification Program and the Home Affordable Refinance Program. They were badly designed and didn't work. HAMP may even have caused more foreclosures than it prevented. In Bull by the Horns Bair is scathing: "HAMP was a program designed to look good in a press release, not to fix the housing market." (I wrote a longer summary of the problems with HAMP here.)

DeMarco wasn't involved. I wonder if the attorneys general are attacking him to divert attention from their own failings. As Barofsky has explained, the widely trumpeted settlement they reached with the banks over fraudulent foreclosure practices was a very bad deal.

(Matthew C. Klein is a contributor to the Ticker. Follow him on Twitter.)