Well, you're forgetting a few steps. The banks took those sketchky mortgages and bundled them into packages. Then they used a software analysis program to show that when you bundle 1000 sketchky mortgages together, they're no longer sketchky, they're investment grade assets. These investment grade assets were sold to Wall St bankers, who of course understood that because a computer analysis said they were investment grade, they must be. And so, they bundled more of these packages together, and sold them as investment funds.
For all of this, the Wall St bankers were paid multimillion dollar performance bonuses. And when they discovered that bundling **** together doesn't change the fact that it's still ****, they got the federal gov't to bail them out, and got more multimillion dollar bonuses.