Failure to regulate or regulatory failure?
Like many regulated industries the financial industry bought the regulation they wanted. Huge contributions and lobbying by the financial industry, led by Fannie and Freddie, bought the lax oversight and government guarantees the financial industry wanted.
So, is that a market failure? It was the free market financial industry that bought access to taxpayer money. Free market incentives led Fannie, Freddie, and commercial banks to take on excessive risk to claim profits for private parties while backed by guarantees and insurance from taxpayers.
Or is it a government failure because government officials sold access to taxpayer guarantees for campaign contributions, contributions to lobbying firms, high paying jobs for Washington insiders, and sweetheart VIP mortgage deals.
It is the government that has the responsibility to look out for taxpayer money and the implied guarantees offered up on behalf of the government. The U.S. Government could not walk away from the implied guarantees to Fannie and Freddie so taxpayer money went out to take over bankrupt institutions that private parties profited handsomely from creating.
Government clearly has the power and responsibility to regulate commercial banks. They simply failed to do that. They allowed commercial banks to get over leveraged and to rely on assets the regulators didn't understand for their capital. Regulators should be aware that banks with insured deposits and especially banks that are "too big to fail" have incentives to take on excess risk and earn additional profits because failure is less likely than for uninsured institutions that aren't "too big to fail".
Investment banks are regulated differently, but if the failure of an investment bank can bring down regulated and insured commercial banks, then commercial bank regulators should have an eye on that risk and either regulate the investment banks or force commercial banks to mitigate the risk even if it means lower profits.
Yes, private greed went unchecked. But it was government policy that turned private greed into a national crisis and put taxpayers and our children on the hook to pay for risky bets that we would not have benefited from if they worked out well.