Why did my bank sell my mortgage
When you first closed on your loan it was probably with a lender who's sole intention was to complete the transaction and sell the mortgage to Fannie Mae or Freddie Mac. The reason lenders sell mortgages to Fannie Mae or Freddie Mac is because they want to keep getting more money to make more loans. They make money off each loan they make by originating the loan and charging you fees and selling the loan to an entity that buys loans such as Fannie Mae or Freddie Mac. They are not using their own money. In essence they just keep enough revolving credit to keep making another loan and selling it. If you want to learn more about this whole process I would suggest "googling" "wholesale lending" "Warehouse lending" and the terms that come up as you read articles on those topics.
Because so many lenders sold their loans off rather than keeping them in their own portfolio over the last several years this created a situation where they really didn't care if the loan was ever going to be repaid. They were paid off when they sold the loan to Fannie Mae or Freddie Mac and so they figured if the buyer defaulted that Fannie or Freddie would take the losses. Because they had this attitude they started getting more and more lax with their underwriting standards. Underwriting is simply the process of evaluating the buyer's credit and finances to try to predict whether they will be able to pay off the loan or whether they will end up not being able to make the payments and default.
Relaxing underwriting standards simply means that rather than denying people loans based on concerns about their finances the loan originating staff gives the underwriting staff a hard time and bunch pressure to find some exception to the normal underwriting rules and go ahead and make the loan even though the buyer was more risky and had credit or other issues.
The problem that banks are now running into is that Fannie and Freddie have begun enforceing "buy back" provisions in their contracts with those they purchased loans from. These buy back provisions allow them to force the originating lender to "buy back" the loan and thus suffer the losses. Before the loan crisis their wasn't a lot of this happening but now there is and it is a major issue for banks. The banks lied to Fannie and Freddie and now are paying the price. Here is an article about Bank of America settling "buy back claims"
So the answer to the question. Why did the bank sell your mortgage is simply that they never intended to keep it. Fannie and Freddie were the intended investors in your loan and your originating lender was just the middleman to take the investor's money and make a loan with it. The investor had rules about the quality of purchaser of the loan. The middle man tried to pull a fast one and just sign up anybody and everybody so they could make more money faster.
Not only have the banks gotten into hot water with the Investors but they have severely damaged the whole housing market by making so many loans that it drove prices up quickly because the free and easy loans created huge demand for limited supply of housing. When all the loans started defaulting and being foreclosed it drove prices down and then even those who were qualified when they purchased but maybe lost a job or had an illness could no longer sell their homes as a strategy to mitigate their circumstances.
The thing to learn from this is that it is not borrowers that caused the bubble and burst. It is the greed of the banks. The banks started a forest fire in essence and now they are trying to blame it on the trees. The borrowers are the trees, the fuel.
People tend to feel bad for investors in these bad loans, those who provided funds for loans by purchasing interests in mortgage backed securities. They can readily see that the investor was duped and lied to. The problem is that people also generally beleive that all borrowers who have defaulted are somehow complicit and bear responsbility for their circumstances.
In court the banks attorneys often point out that nobody promised the purchaser of a home that the value of the home would appreciate and every real estate investment is a risk. This would be a valid statement if the market that each homebuyer was investing in had not been single handedly destroyed by the banks. When normal market forces make a home a bad investment then yes it is just too bad when a homebuyer can't sell a house to get out from under it. When the bank created the huge drop by lying to investors so they could sell more bad loans to them and forcing inflated appraisals and whole host of other dishonest acivities it is hard to blame any of it on the borrower who could afford the home when they bought it but then had a heart attack or lost a job and couldn't sell it a year later.
The responsibility for what has happened falls squarely on the shoulders of the banks.