Don’t forget President Carter started with mandates to provide non discrimination and affordable housing in 1978(?). This, I believe is the tip of the arrow which got this snowball rolling.
The banks, fed, etc. all recognized they could make money with the gov backing the risky loans. The rest of the story is simply reaction to this policy.