1. Despite the one lesson of the Great Depression that everyone learns in High School, that leverage is really bad, investment banks and others had gotten greedy and employed massive amounts of leverage to make lots of money. (Google "leverage" if you don't know what it is.) It was actually a rational decision, because in our system, if you make lots of money with leverage you get huge bonuses, which you can keep when the immense risk you take on combined with small unpredictable market fluctuations inevitably leads to bankrupcy. Other idiots assume that models based on prior market data will predict the future and that they are immune to such failures. Either way, everyone's borrowing much more money than they have as collateral and making stupid investments.
2. One especially stupid investment came about when Bubbles Greenspan lowered interest rates to historically low levels. (I can't complain too much because he also gave me student loans locked in below the rate of inflation - free money!) This encouraged people to buy real estate while mortage rates were at historical once-in-a-lifetime levels. Increased demand for real estate leads to increased pricing, leading to a bubble with a stupid real-estate-can-never-decline-because-it-is-something-"real" mentality. Everyone assumes that land and houses have a magical power to make everyone rich without putting in any work or otherwise creating anything of value. Banks are willing to accept overvalued homes as collateral for massive loans made out to people with no realistic way to pay them back. Exotic loans like ARMs are also made available to create the illusion of affordability.
3. Banks and credit rating agencies decide that risk can be reduced by chopping up different people's loans and putting them together into mortage securities, missing the fact that the performance of one's person's loan might have some correlation with his neighbor, given that they are subject to the same socioeconomic factors within the same housing bubble. The value of things goes up merely by redistributing them! Another way to get rich without doing any work! Fannie Mae and Freddie Mac buy this crap from the other investment banks and sell them to foreign investors, who buy it because, although the US government has never said they would, they assume the US government will bail them out if things go badly.
4. Things go badly as the bubble bursts and real estate values return to rational levels, destroying the fake collateral that backed up the now worthless loans. Many people can't pay their loans, and others have no reason to because their house is worth less than the money they owe on their mortgages. Because of massive leverage, Bear Stearns and Lehman Bros are screwed. Likely many others as well. The US government bails out the foreign investors who bought the bonds from Fannie and Freddie. All the money that was made without doing any work? Turns out that money will come from US taxpayers.