Justin Fox points out that essentially:
AIG got into the business of insuring much of the world's financial system against the consequences of a global financial meltdown. It turned out to be incapable of delivering on that insurance—no private company could deliver on it, which is one reason why AIG's business of selling credit default swaps was a scam. And so government has stepped in as the ultimate insurer.
Credit default swaps that AIG sold were insurance against a financial collapse. But just as a private insurer cannot insure against a flood -- that is why the government provides flood insurance -- a private insurer cannot insure against the whole financial system collapsing. Thus, there should be no shock at taxpayers ending up liable for this mess. The crime is not the bailout, but the fact that AIG managers got rich selling insurance they could not possible back.