NEW YORK (TheStreet) -- The battle over Fannie Mae (FNMA) and Freddie Mac (FMCC) is heating up, and it would appear that Mario Ugoletti will be very busy answering questions in court for the foreseeable future.

Ugoletti served as the U.S. Treasury's director of the Office of Financial Institutions Policy and participated in the drawing up of the government's agreement to bail out Fannie and Freddie, while later serving as a special adviser to former acting Federal Housing Finance Agency Director Edward Demarco and helping draw up the subsequent agreement through which nearly all of the government sponsored enterprises' profits are being swept to the government, leaving private investors in the cold. Ugoletti now serves as a special adviser to FHFA Director Mel Watt, who assumed his post in January. 

Ugoletti's written testimony provided for a class action suit raises many questions about the government's decision to take nearly all of the profits of Fannie Mae and Freddie Mac in the form of dividends, a well as the timing of the decision.

First, some background:

Fannie Mae and Freddie Mac, the two mortgage giants that together purchase the vast majority of newly originated mortgage loans in the United States, are known as the government sponsored enterprises, or GSEs. The GSEs at the height of the credit crisis in September 2008 were facing insolvency and were therefore taken under government conservatorship.

The GSEs are regulated by the FHFA, which is directly controlling Fannie and Freddie since they remain in conservatorship.

Under their original conservatorship agreements, the GSEs were required to pay the government annual dividends of 10% on senior preferred shares issued to the U.S. Treasury for bailout assistance.

Through the fourth quarter of 2011, Fannie Mae continued to make draws from the Treasury -- that is, to borrow more -- in part to cover the 10% dividends it owed to the Treasury, until the value of the Treasury's preferred shares in Fannie increased to $117.1 billion.

Freddie made a small draw on the Treasury during the first quarter of 2012, bringing the government's preferred stake in that company up to $72.3 billion. The Treasury in 2008 was also handed warrants to acquire up to 79.9% of the GSEs common shares, "for a nominal" payment, according to testimony provided by Ugoletti after being subpoenaed as part of a class action lawsuit brought against the government by a group of private investors -- including Fairholme Funds -- holding common and junior preferred GSE shares.

While their borrowings from the Treasury were growing, the GSEs didn't issue additional senior preferred shares to the government. Instead, the value of the government's preferred stakes in Fannie and Freddie grew from their initial values of $1 billion apiece.

So the Treasury's stake in the GSEs has totaled $189.4 billion since the end of the first quarter in 2012, and both GSEs have been profitable since the second quarter of 2012. On August 17, 2012, after Fannie Mae reported second-quarter income of $5.1 billion and after Freddie Mac reported second-quarter income of $3.0 billion, The FHFA and the Treasury agreed on a "third amendment" to the original bailout agreements, through which all profits of Fannie Mae and Freddie Mac, save initial capital cushions of $3 billion for each GSE, would be swept to the Treasury.

To backtrack for a moment -- the "second amendment" to the bailout agreements called for an "initial cap" on the Treasury's investment in the GSEs of $200 billion, plus the amount of draws made through the end of 2012.

With the GSEs not only having returned to profitability but having stopped making draws on the Treasury, it was no surprise to see private investors suing the government for a seat at the table.

Fannie and Freddie both announced their second-quarter earnings this week, along with significant dividend payments to be made in March. Following the March payments, the GSEs' dividends paid to the government will total $199 billion, exceeding the value of the Treasury's investment over a period of roughly five years. That's a fat return -- far greater than the original 10% coupon on the government's senior preferred shares -- and there is no mechanism in place for either Fannie or Freddie to repurchase any of the government-held preferred shares.

A major portion of those dividends was made possible by the recovery of nearly $71 billion in deferred tax asset (DTA) valuation allowances by Fannie and Freddie during 2013, however, the GSEs are currently earning enough to have plenty of cash left over to rebuild their capital if they were paying the government the original 10% dividend, and would possibly be able eventually to begin paying back the government's principal investment, if they were allowed to.

With so much money coming in from the GSEs, money which lowers the federal deficit, nobody in Washington has much incentive to do anything other than keep the status quo for as long as possible.

Shares of Fannie and Freddie were very strong on Wednesday and Thursday, after Judge Margaret Sweeney in the U.S. Court of Federal Claims ruled that the Fairholme lawsuit against the government could proceed to the discovery phase. The government had sought to have the Fairholme lawsuit thrown out.

This all brings us back to Mr. Ugoletti.

Windfall to Government

In his written testimony in December, Ugoletti said the third amendment to the bailout agreement in August 2012 -- through which nearly all of Fannie and Freddie's earnings are being swept to the government -- was made to "resolve" concerns that the Treasury wouldn't be able to maintain its commitment to support the GSEs.

The following is from Ugoletti's written testimony:

Thus, the intention of the Third Amendment was not to increase compensation to the Treasury -- the amendment would not do that -- but to protect the Enterprises from the erosion of the Treasury commitment that was threatened by the fixed dividend.

It sure didn't turn out that way. The Treasury has been paid much much more than the original 10% it was looking for.

Nobody Considered the DTA?

Ugoletti also said:

At the time of the negotiation and execution of the Third Amendment, the Conservator and the Enterprises had not yet begun to discuss whether or when the Enterprises would be able to recognize any value of their deferred tax assets. Thus neither the Conservator nor Treasury envisioned at the time of the Third Amendment that Fannie Mae's valuation allowance on its deferred tax assets would be reversed in early 2013, resulting in a sudden and substantial increase in Fannie Mae's net worth, which was paid to the Treasury in mid-2013 by virtue of the net worth dividend.

Ugoletti expects us to believe that a team of professionals, charged with managing two huge entities with combined balance sheets of $5.3 trillion in June 2012, hadn't considered that the GSEs, having returned to profitability in the midst of the U.S. housing recovery, would be able to recover their deferred tax assets. It seems incredible that the FHFA would have overlooked such an important accounting item.  The path toward DTA recovery should have been clear, because both GSEs were profitable during the second quarter of 2002, both had stopped increasing their borrowings from the government and both comfortably covered their 10% dividends to the Treasury for that quarter.

Were Their Backs Really to the Wall?

Ugoletti in his testimony also said:

By late 2011, analysts and key stakeholders, including institutional and Asian investors in the Enterprises' debt and mortgage backed securities (MBS), began expressing concerns about the adequacy of Treasury's financial commitment to the Enterprises after January 1, 2013, when the cap on the Treasury's funding would become fixed.

OK, that's a valid concern. However, the market hadn't fallen out for Fannie or Freddie's MBS by August 2012, when both GSEs were clearly profitable and after both had easily covered their second-quarter 2012 dividends. Why was there a rush to put the sweep of nearly all GSE dividends to the Treasury in place, when nobody's back was to the wall?

The Federal Housing Finance Agency responded to a request comment from Ugoletti by saying the agency would be unable to comment.

Institutional investors holding junior preferred and common shares of Fannie and Freddie believe they are in a winning position, although they will to wait quite some time for the court cases to be resolved.

Following gains of 11% each on Wednesday, common shares of the GSEs were again very strong on Thursday. Fannie's common shares were up 11% in afternoon trading to $4.96, while Freddie's common shares were up 13% to $4.86, after that company reported its fourth-quarter earnings.

The GSEs' junior preferred shares were also strong, with Fannie Mae's preferred Series F shares (FNMAS) shares 9.6% to $12.05, and Freddie's preferred Series Z (FMCKJ) up 6.8% to $12.34. Both preferred issues have face values of $25.00.

Follow @PhilipvanDoorn

Philip W. van Doorn is a member of TheStreet's banking and finance team, commenting on industry and regulatory trends. He previously served as the senior analyst for Ratings, responsible for assigning financial strength ratings to banks and savings and loan institutions. Mr. van Doorn previously served as a loan operations officer at Riverside National Bank in Fort Pierce, Fla., and as a credit analyst at the Federal Home Loan Bank of New York, where he monitored banks in New York, New Jersey and Puerto Rico. Mr. van Doorn has additional experience in the mutual fund and computer software industries. He holds a bachelor of science in business administration from Long Island University.