Earlier, Megan echoed Kevin Drum's question about why capital flowed into housing, creating a bubble: "Why didn't it flow into productive investments instead? Why did investment in real goods and services suddenly become so much less attractive than housing?" Let me give this a shot, because I never found it that mysterious.
In a sense, it was a perfect economic storm directed towards housing. On the consumer side, investor side, government side, and interest rates side, all indications were that investing in residential mortgages and real estate more broadly seemed like a pretty good idea at the time. Let's think about each of these factors separately.
Consumers
When I say "consumers," I kind of just mean average Americans who aren't professional investors. I've long wondered how anyone who isn't a finance professional can ever hope to really consistently make a lot of money in the stock market. Unless you have an incredible amount of time to dedicate to stock research or are incredibly lucky, then you might as well throw darts at the newspaper stock listings.
But in the early 2000s, consumers got even more wary of stocks. First, the dotcom bubble burst. So any amateur investor who thought tech was a sure thing got a rude awakening. Then there were the Enron and Worldcom debacles. Now, even seemingly good companies in "safe" industries like energy and telecommunications might be fraud-ridden and end up going bust. So where should a poor sap who doesn't have an MBA from Wharton put his money? Well, real estate is always a good bet, right? And there aren't any P/E ratios or bond yields to analyze -- it's just a house on a plot of land that will appreciate over time.
Sure, the return on real estate might be traditionally lower than stocks and bonds, but no one ever really loses money on real estate -- at least that was the sentiment. So rather than use excess income to buy stocks, why not get a more expensive house and use the money towards higher mortgage payments? After all, it will pay off in the long-run, right?
Investors
A similar sentiment gripped even professional investors, as Mike Konzcal notes. They wanted somewhere safe to put their money, and mortgage-backed securities (MBS) seemed like a good place. They looked a lot like other AAA-bonds, but better. They paid a higher return than Treasuries, and were secured (which usually means safer), unlike corporate debt.
Of course, MBS had been around for decades, so why did it expand so much in the 2000s? One reason is a possible demand shift, as explained above. But there was also a technology change. Personal computers finally began to have the ability to easily analyze giant pools of loan-level data. In the early to mid 1990s, data like that just couldn't be utilized as easily by banks -- and almost certainly couldn't be modeled by investors with tighter technology budgets. But in the 2000s, all you needed was Microsoft Excel, Microsoft Access and a reasonably new computer with a fair sized hard drive and a few gigs of memory.
This allowed MBS to appear more approachable (greater demand). It also allowed banks to analyze loan tapes much more quickly, so they could close deals faster (greater supply). Banks could lend out a heap of money on mortgages, quickly securitize the pool, collect a profit on the pool's interest rate spread versus what they sold the bonds for, and have a new heap of funding to do it again, and again, and again. . . It was easy money.
Better technology also gave rise to more exotic structured finance innovation like synthetic collateralized debt obligations (CDOs) as well, which could now be more easily modeled.
Government
Since the late 1990s, government sponsored entities also began expanding their involvement in the mortgage industry. Standards were relaxed, and mortgage exposure limits were pushed higher and higher. This, in turn, made investors feel like much of the MBS they purchased was even safer, with an implicit government backing. They were as safe as Treasuries, but with a better yield.
Interest Rates
Then, there were interest rates. Here are historical mortgage interest rates, based on the mortgagedailynews.com data.*
As you can see, from 2002 through 2005, mortgage rates were at lower levels that most homeowners had ever seen. That encouraged refinancing. I wish I knew what portion of homes in America were refinance during this period, but I have to think it was an incredibly large portion.
I also suspect the Baby Boomers, in particular, did an awful lot of refinancing. They likely often cashed out some of their gains as well, since they are notoriously bad savers. They then spent that money on stuff like luxury items, vacations and even second homes.
In addition to refinancing, ultra-low interest rates also encouraged purchases. Lower interest rates provided lower monthly payments. That resulted in more renters being able to participate in the American dream of owning a home. Current homeowners could upgrade to a bigger, nicer, more expensive home for the same monthly payment. Wacky mortgage products made such upgrades even easier. Demand soared, increasing home prices.
All that refinancing and purchase activity produced an enormous amount of MBS volume as well, providing more of the seemingly "safe" securities with pretty good yields for investors to scoop up. Excess supply made the bonds even more attractive.
There are other more subtle reasons within these four categories as well. I could also get into why banks liked MBS due to new capital regulatory schemes, for example. But this serves as a good start. Essentially every facet of the economy had incentive to get on the housing train, so when it derailed a catastrophic disaster followed.
*Originally, I used the Fed Funds Rate here, but this chart is better, since this shows specifically mortgage rates, and Fed Funds doesn't always correlate so well.