Its not about risk management. Banks don't care about risk because they can dump all the crap on the US government. Rather, banks are required to buy treasuries in exchange for the Fed taking the toxic MBS off their bogus balance sheets. Must have a load of horse manure inside those banks.
Banks immediately re-sell most of their mortgages on the secondary market (for example, to Fannie Mae). So instead of interest they receive service fees (for servicing the loans - collecting payments, etc). This is much better than treasuries because a) you get your money back and can use it again; and b) you don't have any interest rate risk.