I don't know where this "banks were forced by the government to sell bad loans" bullcrap started but it's as much spindoctory now as it ever was. Watch some interviews with actual economists and ex-regulators. Read some of the door-stopper books they've written.
Put simply, the Federal Reserve rules on banking practices were rendered so toothless that some investment managers figured out they could inflate their company's bottom line by selling crap loans and mortgages, wrapping them into divisioned debt-bundles and derivative loans, and a bunch of other voodoo crap that can be better understood as a semi-legal form of money laundering. Nobody knew enough about all these new smoke-and-mirror constructions to even question their value, much less what was backing them up. And by "nobody" I mean other bankers, who were mostly selling these things to each other. Hence why they all went down together, further fueled along by (what I consider a mind-blowing state of affairs) the allowance that corporations can take out insurance policies on things they don't own. Like say, their competitor companies, so they have a payback incentive to burn the market to the ground, beyond just putting their rivals out of business.
But what happened was, since the early 1980s, all notion of bank regulation and oversight was completely gutted out of the government. Investigation and clearance was contracted out to private observer agencies, whose official business model was to sell their "regulatory" services to the bank they watched, not the Federal Reserve. In other words, it became a race to the bottom of which rating agency could offer the loosest interpretation of the rules, so no one who could do or say anything about these banking practices really even knew it was happening, and were too distracted by the awesome DOW Jones figures to care.
It was an entire industry founded on making up numbers and hiding bad assets, caused and created entirely by a lack of government oversight and regulation, at the behest of slavish worship of the free-market principle of swindling the fuck out of anyone you can and squirreling away your eight-figure bonuses in the Cayman Islands before the IRS comes calling. Bernie Madoff was just one step beyond crooked compared to the rest of the banking industry, in that he didn't even have the pretense of an actual business.