Why the Government Is Suing Standard & Poor's - Rick Newman (usnews.com)
The problem developed when mortgage lenders began granting loans to unqualified borrowers who should not have gotten them. When home values started to fall, the home equity many of those borrowers had been counting on evaporated, and default rates skyrocketed.
The system failed because nobody accounted for the high proportion of risky loans that ended up rolled into mortgage-related securities, a huge asset class that amounted to at least $3 trillion worth of investments by 2007. Brokers earned fees for each loan they originated, which gave them an incentive to ignore underwriting standards and write as many loans as possible, and even commit fraud.
Banks that made the loans became accustomed to selling them off as investments, reducing their own interest in validating the quality of the loan, since they'd no longer be holding it if something went wrong.