The government has nixed a plan for Fannie Mae to sell over $2.5 billion worth of low-income housing tax credits to Goldman Sachs and Warren Buffett’s company Berkshire Hathaway.

The Treasury Department canceled the move, saying the loss in tax revenue to the government would exceed the savings (see Who Should Get Fannie Mae’s Tax Credits?). Fannie Mae cannot use the tax credits itself because of its continuing losses.

The federal government effectively took over the struggling mortgage holder last year during the financial crisis, and the company’s prospects have not gotten much better of late. The Federal Housing Finance Administration had not objected to the sale of the tax credits, but the Treasury had a different opinion.

In an SEC filing, the company said, “On November 6, 2009, Treasury notified FHFA and us by letter that it is not consenting to the proposed transaction. In its letter, Treasury stated that it weighed several considerations in deciding whether to provide or withhold approval of the proposed transaction and that, in its view, the proposed sale would result in a loss of aggregate tax revenues that would be greater than the savings to the federal government from a reduction in the capital contribution obligation of Treasury to Fannie Mae under the senior preferred stock purchase agreement. Treasury further stated that withholding approval of the proposed sale affords more protection of the taxpayers than does providing approval.”

Fannie Mae said its conservator has directed the company to continue to explore options for selling the “investments,” but it now believes that will be more difficult given the current constraints and market conditions. If it is unsuccessful at selling or otherwise transferring the tax credits, Fannie Mae will have to record additional other-than-temporary impairment in the fourth quarter that could reduce the carrying value of the LIHTC investments to zero. As of Sept. 30, the carrying value of the LIHTC investments was $5.2 billion.

Going from $5.2 billion to zero in a matter of a few months is not going to make for a pretty picture at Fannie Mae, or for the housing market.