The lack of regulation was part of it, particularly the belief that financial companies would not take excessive risk.
However, none of this could have happened without excessively low interest rates. All bubbles have excessive liquidity at the heart of the imbalance, regardless of the level of regulation. The lack of regulation merely poured gas on a fire. The tech bubble was a classic bubble, for example, with excess liquidity and new technologies causing insane stock valuations. Regulations had almost nothing to do with the tech bubble.
And to expand, for the others here, that bubble's pop was "fixed" by reducing the target rate to eventually 1% in 2002, which sparked yet ANOTHER excess in liquidity.
That excess, coupled with the historically low rate of 1%, is what jump started the housing boom. All that money had to find a place to go to work, and home buying was pushed on to us through various media outlets, advertisements, etc.
People generally don't do a whole lot of thinking on their own, so naturally they were enticed into buying homes en masse, because that eventually became the cool thing to do.
When you couple low rates, excess liquidity, the keeping up with the jones' mentality, and limited economic knowledge among the masses, you have yourself everything you need to create a bubble of historic proportions.
You can regulate consumers and banks to death, and all you're going to have is a society of weak, irresponsible, undereducated consumers still playing the same game with credit, because all that really matters to most consumers is how much the interest is going to be, and whether or not it's worth it to borrow.
When the federal rate is at 1%, when will it ever be cheaper to borrow? Probably NEVER.