Irresponsible speculation in dubious securities by investment banks who knew the government would bail them out (or bail out the insurance companies underwriting their risk, which comes to the same thing) because they were "too big to fail".
And the dubious securities themselves were derivatives based on the housing market, which was in a huge bubble caused by government policies that basically forced banks to lend to people who couldn't afford the loans in order to encourage home ownership, as antepodius pointed out.
I thought it was because of irresponsible speculation in dubious securities backed by by corrupt rating houses?