As The Economist pointed out when the whole mess began, the problem was too much government regulation and too little government regulation at the same time.
Home ownership is a good thing and certain groups had been barred from home ownership for reasons other than economic ones. Governments stepped in the correct that problem and, as governments almost always do, over corrected the problem.
Lending programs, which were nobly meant to assist historically disadvantaged groups, were kept in place long after anyone in those groups who were actually credit worthy got a loan. Banks and other lenders were criminally prosecuted for, at first, actually red-lining socioeconomic groups for non-economic reasons and then, later, for only seeming to red-line socioeconomic groups for non-economic reasons. Banks were thus encouraged by both government guarantees and criminal prosecutions to lend to people who would have never received any loan on a purely economic basis. Compounding the problem, people who could receive loans got larger loans than they normally should have.
The bubble was built by governments' lending programs and the governments' insistence that people get loans they could never qualify for or loans larger than they could qualify for.
The second part of the problem was deregulation. Just as governments were deliberately increasing the numbers of bad loans and guaranteeing many of those loans, governments also loosened their oversight of the banks and institutions making and holding those loans. The banks, eager to minimize their exposure despite government promises to cover defaults, spun these potential bad loans off in iteration after iteration of financial instruments, instruments that were no longer regulated or even investigated by the governments in question thanks to deregulation. In fact, many of the instruments that eventually blew up and wrecked the world's economy could have never been created if deregulation hadn't occurred.
So, governments greatly increased the numbers of bad, fraudulent, shaky, and over-sized loans while at the same time lessening their scrutiny of the institutions making, holding, and trading those loans.
They were filling the tire and ignoring the pressure gauge at the same time. Is it any wonder things popped?