Despite last week’s protestations by Treasury Secretary Hank Paulson and Federal Reserve Chief Ben Bernanke, markets knew that Fannie Mae and Freddie Mac were not well capitalized.

Markets also anticipated the weekend bailout announcement by bidding down the share prices of the two mortgage giants, and also bidding up the prices of their debt (driving down their interest rates). That was a bet that the forthcoming bailout would result in a dilution of shareholder value, and protection for the bondholders.

Yields on Treasuries rose, as the government’s balance sheet was expected to expand by whatever the net liabilities of these two companies might be (less, presumably, than their $5.3 trillion gross liabilities). The dollar tumbled in anticipation of more deficits, and more inflation to pay for all this.

The focus must now be on the way forward. This should entail putting both institutions on a sound financial footing, and never again allowing them to become a drain on the taxpayer and a threat to financial stability.

By last week, both corporations were operating at odds with their own charters. Consider Freddie Mac, chartered by Congress in 1970. Its first stated purpose was “to provide stability” in the secondary mortgage market. Its second purpose (of four) was “to respond appropriately to the private capital market.” But Freddie and Fannie had both become a source of financial market instability, helping to drag down share prices of other firms exposed to their obligations, and forcing private capital markets to respond to their possible collapse.

Whatever the outlines of what will inevitably be a hastily crafted bailout plan, the result must be true privatization. That means no more government lifeline: no Treasury line of credit, no Fed line of credit.

If the government takes an equity stake in the companies as part of a bailout plan, there needs to be a time line to end government ownership. Freddie and Fannie must cease to be “special,” and become quite ordinary.

They must also be downsized, because institutions so dominant in housing cannot be truly private. Additionally, as banking expert Bert Ely has pointed out, Freddie and Fannie have bulked up their balance sheets by taking on excessive interest-rate risk. Like savings and loans in the 1980s, Fannie and Freddie have maturity mismatch — borrowing short and lending long. That risk is a function of their large holdings of mortgage-backed securities. No matter their efforts at hedging that risk (which has previously landed them in trouble), there are no perfect hedges.

Fannie and Freddie must also be reformed because of their role in the culture of corruption in Washington. They have become political ATM machines for campaign contributions. That has to stop.

We must also realize that, whatever the deficiencies of the mortgage market in Depression-era America, that era is over. There is no “market failure” in housing finance today, except the one created by government-backed institutions dominating housing finance. Money flows where it is rewarded. Home mortgages are plain vanilla financial instruments, perhaps partly due to Fannie and Freddie. So by all means, let us thank them for their service as we bid them adieu in their present form.

As nearly every responsible commentator has observed, Fannie and Freddie urgently need more capital. Thus we have an overall diagnosis and treatment plan: downsizing and capital infusions. In the near term, the capital may come from Treasury because of the dire condition of their share prices. Congress could authorize the Treasury to purchase shares of preferred stock convertible into common shares in, say, five years, but it would have a mandatory conversion feature in 10 years. At that point, the Treasury should be required to sell its common stock in an orderly fashion (but within two years). Socialism in housing finance must not be made permanent.

Over the course of the 10-year period, Fannie and Freddie should systematically sell off their security portfolio and raise additional capital. By the end of that period (or sooner, if management desires to get out from under the government’s yoke), their capital ratios should be up to the level of a commercial bank: 6%-8% of assets.

Follow these guidelines and at the end of 10 years, perhaps sooner, we could have a truly competitive market in housing finance. No single institution, nor a duopoly, would play a crucial role in housing finance. The idea that a government-sponsored enterprise is needed to provide liquidity is at best obsolete. Global financial markets provide liquidity, except when impeded by the effects of bad, government-directed policies. Credit allocation and easy money created a housing mess that now threatens the viability of even government-sponsored enterprises. Never again.

These recommendations run counter to the prevailing wisdom at the Treasury and the Fed, which is to encourage ever larger institutions, too big to fail, which can be then placed under Fed ministrations. Let us not resolve one crisis by sowing the seeds of the next. We need to empower markets, not embolden central bankers.