Five years ago this month, the Federal Housing Finance Agency, barely a month old, faced a crisis.

Working with Federal Reserve Chairman Ben Bernanke and Secretary of the Treasury Secretary Henry Paulson, we had to put Fannie Mae and Freddie Mac, housing finance giants with a combined $5.5 trillion in mortgages, into conservatorship. The move was necessary to protect the housing market and fixed-income investors and prevent a massive market crash. It was a sad day, the result of many mistakes made by Congress, presidential administrations, management teams, shareholders, investors, mortgage originators and packagers, homebuyers – and yes, regulators.

"An ounce of prevention is worth a pound of cure" is a wise old saying that is often forgotten in Washington. In the case of the mortgage crisis, it was trillions of dollars of cures.

On behalf of taxpayers and those of us who were asking Congress for prevention well before the crisis, I ask Congress and the Administration, as they address mortgage reform again, to keep prevention in the forefront of their minds.

Housing markets are very cyclical, thanks in no small part to public policy. Prior to the crash, many elements of legislation encouraged the growth of bubbles and the ensuing crashes and continue to do so today.

To reform the housing market and prevent the next crisis, we need to look at the root causes. A Presidential Commission and many others have studied the causes of the crisis. Most assessments tend to be U.S.-centric, forgetting that there were housing bubbles that burst in many other countries, none of which had a Fannie Mae and Freddie Mac. There were also many commercial real estate bubbles. In fact, the nearly 500 U.S. banks that were closed by the Federal Deposit Insurance Corp. were done in primarily by commercial real estate losses.

Common elements around the world were excess liquidity and excess leverage. Borrowers, bankers and investors in mortgages assumed house prices could only go up and ignored the risks. Regulators were slow to react. In the case of the U.S., the bubble was further inflated by toxic private label securities, backed by poorly underwritten mortgages and inadequately rated by the rating agencies.

The government-sponsored enterprises – Freddie Mac, Fannie Mae and the Federal Home Loan Banks – were the biggest buyers of the AAA-rated tranches of those mortgage-backed securities. These purchases helped the GSEs show growth and increasing profits. Fannie and Freddie had further motivation as some of these MBS were rich in "affordable" mortgages. To meet these unrealistic affordability goals set by legislation and the Department of Housing and Urban Development, they were also direct buyers of mortgages that were potentially troubled. Meeting these goals was critical to their management teams, as it kept Congress happy and reduced the pressure for much needed reform. A critical element of that reform, which came much too late, was to give the regulator power to raise capital requirements from the wholly inadequate 1% level.

As Congress and the administration finally undertake housing finance reform, one lesson to learn, which seems to be widely accepted, is that you cannot mix government functions with for-profit institutions. As I said when I announced the conservatorships on Sept. 7, 2008, there was an "inherent conflict and flawed business model embedded in the Enterprises' structure." Also widely accepted is the need for stronger mortgage regulation and better homebuyer education.

To me, another extremely important lesson to learn, and not just in the U.S., is that mechanisms have to be created to dampen the volatility of housing finance. On the downside, though it is not fashionable to say this, the crisis would have been a lot worse had Fannie and Freddie not continued to insure mortgages in 2008 and thereafter with Treasury backing.

The Enterprises were also instrumental in relieving the pressure on millions of homeowners under the Home Affordable Modification and Refinance programs, which we had suggested to the Obama Administration. Preventing the "irrational exuberance" in unfettered markets is difficult because it is not popular to take away the punch bowl. What is needed is a "hard wired" counter-cyclical mechanism.

The Senate Corker-Warner housing reform bill could be a good start in that direction. The proposed purely governmental Federal Mortgage Insurance Co., if structured properly, could play a countercyclical role. Having run the Pension Benefit Guaranty Corp., I know that it is not easy to create a government insurance program. Preventing future crashes in the $10 trillion mortgage market is worth the effort. We now have a great case study of how not to structure an insurance program in the GSEs. The FMIC should act as a backup, catastrophic MBS insurer for a much smaller segment of the market than the government's 85%+ share today. To provide counter-cyclicality if housing prices rise well above the trend line, FMIC could pull back by decreasing its share of the market and raising prices. In a significant downturn the guarantor could do the opposite.

The key lesson from the global financial crisis is that whatever structures replace Fannie and Freddie, they must be built to achieve job one – preventing future crises.

James B. Lockhart served as director of the FHFA and its predecessor, the Office of Federal Housing Enterprise Oversight. He is now the vice chairman of WL Ross & Co. LLC, a private equity firm.