It was caused in part by deregulation (less rules for banks), and in part by regulations that existed (pressure on banks to do subprime loans). That's what allows both sides to blame the other. If only we didn't deregulate ! If only we didn't have those regulations !
Then, the whole thing was made worse than it was by politics, and politicians on both sides with doom and gloom rhetoric saying the world was coming to an end, and they needed our votes to prevent it. (Obama played a role in that. Romney is doing the same thing. Credit to McCain for not doing it).