There are big differences between AIG, Bear and Fannie / Freddie.
With AIG the government basically buys a good firm at a good price, most likely they will see a nice profit. If they let AIG fall then everyone will lose much more just from the hysteria that would result.
The case of Bear is a bad dill, because the government agreed to take all the bad risky assets of Bear and let JPM to by the leftovers of Bear for a cheap price with no risk attached.
Fannie and Freddie are sick puppies back they had a historic and 'implicit' government backing, so really there was no choice but to nationalize them.