Credit expansion was alive and well:
AFAIK, the discount window was more or less obsolete in the 2000's till the financial crisis hit.
Sure, the market would have been smaller without CDO's and all of the other financial instruments that arose in the 2000's and before. But that isn't a bad thing. You want an efficient financial system that gets credit to where it's most direly wanted. The problem was that there was an oversupply of credit fueling an unsustainable expansion in the housing market.
ok but based on M2 doesn't explain why investment banks suddenly started to fund risky loans
M2 will grow as there is more money in the economy. As RE prices rose it the asset bubble grew it drives up M2
investment banks were not regulated by the Federal Reserve at that time ( to the best of my knowledge)
Lehman, Bear Stearns etc.. could never have created and sold these risky loans without having the triple A bond rate or the CDO's (collateralization) or CDS (insurance against default)
AIG was of course a big part of this too as they were selling insurance without having the necessary reserves (which I why they became insolvent in one day as soon as their rating was downgraded which immediately required more reserves which they did not have)
I certainly believe the Fed played a role but I don't think they were the cause