The market is efficient in the long term, but inefficient in the short term. In times of great uncertainty, the market value of an investment will be much different than the actual value of the investment.
Bonds and MBS(s) were being severely undervalued because no-one knew where the toxic waste was and just how toxic it was. Countrywide didn’t have the most toxic junk. Wachovia does. They continued funding these until the last second.. Washington Mutual was not too far behind.