You are correct in one sense. The Feds did tell Bank of America to buy Countrywide, which would have filed for bankruptcy if Bank of America had not acquired it. It is also true that many of the problems in mortgage foreclosures have come from the Countrywide portfolio. The issue relates largely to the Mortgage Electronic Registration System (MERS) that was used for mortgages that were securitized. Since the mortgages were going to be sold and resold, it would have been inconvenient to constantly deliver and re-deliver and re-re-deliver the original mortgages and promissory notes to successive purchasers. So the mortgages were electronically registered in the name of MERS, and the original notes and mortgages were held by a designated custodian. Unfortunately, many of the original documents did not make it to the custodian, and many others were either lost or misfiled. As a consequence, nobody can find the original documents. This is very problematical when a lender is trying to foreclose, since the lender cannot produce the original contract.
The Feds didn't cause the problem (MERS is an entirely private organization), but they knew about it, and did nothing. Bank of America was stuck with many of these loans when it acquired Countrywide at the Feds' insistence. Now the Feds -- having foisted this problem on Bank of America -- are going after the Bank. There is a distinct element of unfairness here. But the Feds are highly political, and they really don't care.