It may well have been the right decision, all things considered, but I must say I really don't like it. The obvious points are moral hazard plus the question of exactly what the government is going to do with the new asset in its portfolio.
Interesting point about this is that the decision was presumably made by Bernanke and Paulson. These are the rare Bush Administration appointees - Gates comes to mind as well - whom I personally would trust in these matters as much as the average appointee in, say, a Reagan, Bush Sr., Clinton, or Obama Administration. (Maybe more than the average, given the hacks that are likely to be appointed to some roles in any Administration - so let's say I trust Bernanke and Paulson as much as the average good appointee in a historically typical Administration.)
But even so, any appointee in such a position arguably has slightly skewed incentives. (I would as well if I were the officeholder.) While the catastrophic downside that you are trying to prevent (if serving at the Fed or in the Treasury) obviously does in fact matter enormously, it arguably matters a little more to you than it does socially. Given that your job is to prevent it, and that you will go down in history as a horrendous failure if it happens on your watch, the clear incentive structure is to err on the side of worsening moral hazard, rather than of taking a bit too large a chance of an economic meltdown.
Over time, then, one would expect too many rescues, and I fear that this may fit and feed into that scenario.
UPDATE: It's interesting to observe, though I'm not sure what to make of it yet, that the market fell more than 400 points today despite / because of / without being affected by the AIG rescue.