Not 'markets' but US government financial regulations were the principal cause of the credit crisis. I've written here before about the 'anti-redlining' laws: regulations to stop lenders refusing loans to people who happened to live in a poor part of town. That gave millions of poor people access to home loans – but at the expense of the institutions taking on riskier customers.
Now the loans have gone bad, the housing market is ailing, and the institutions are in pain. So the government steps in and takes over control of the mortgage lenders Fannie Mae and Freddie Mac.
Once Freddie and Fannie had about three-quarters of the mortgage market. But then the Fed decided that they should be classified more like hedge funds. But of course they then didn't meet the hedge fund accounting regulations... Put into the penalty box, they lost their top management and weren't able to ply their trade – just at the time when, thanks to plummeting interest rates, everyone else was re-financing their book to advantage.
All sorts of new products popped up on lenders' balance sheets – derivatives and other instruments with high yields, large leverage and riskier, narrower spreads. A mix of assets that the rating agencies didn't know how to rate. So trouble was stacking up but few people quite realized it. Fannie and Freddie were eclipsed, their mortgage share slid drastically.
When you snap a twig in a quiet room, the sound echoes. On a busy street, you can't hear it. When markets are changing rapidly, market players can easily miss the signal of things going wrong from the noise of universal change. Until it's too late. It is the regulators, who precipitated the market turmoil, that we should blame for things going wrong, not the market system.