Recent reports suggest that both the TARP payouts to big banks as well the government bailout of AIG will be fully repaid. Scott Sumner says this has changed his mind about the supposed moral hazard problem of banks that are too big to fail:
It appears that at the end of the day the biggest banking fiasco in the history of the universe will not result in any long run net taxpayer transfer to big banks. And yet the owners and managers of those banks incurred mind-boggling losses. So how plausible is it that TBTF was the primary cause of excessive risk taking in 2004-07? If even a crisis this big didn’t result in the long-run transfer of one cent of taxpayer money to big banks, does it seem likely that expectations of those transfers were a powerful motivating factor in the MBSs they bought?
I guess I'd look at this differently. I've always been a little skeptical of the pure moral hazard argument. Until the end came, my guess is that no one at any of the big banks expected to fail and therefore none of them expected to need bailing out. Partly this is because they believed in their own risk management strategies and partly it's because the kind of people who make it big on Wall Street are all convinced that they're smart enough to avoid disaster. Sure, good times and bad will always be with us, but they figure they can ride out the bad times even if some of the guys across the street don't.
So in this sense they weren't motivated by the expectation of a government bailout. But there are at least two other problems that are related but not identical to pure moral hazard. For one, big banks are where the big money is, and in a recent paper Vanderbilt's Margaret Blair argues that executives at big banks therefore have an incentive to amass dangerous amounts of leverage even if they know that this can lead to systemically threatening boom and bust cycles:
Bubble and crash cycles  can be quite lucrative for the financial market participants who help to create them. This is because of the asymmetric nature of the gains and losses — financiers and shareholders of financial firms take home sizeable wages, bonuses, and dividends in good years, but are not required to pay these back in bad years. For this reason, financial markets will not be self-correcting and self-regulating.
....The effect of repeated bubble and crash cycles in the economy has been a steady ratcheting up of compensation in the financial sector, which has exacerbated the trend toward ever widening distribution of wealth and income in the U.S. In fact, the growing wealth of the financier class might be self-perpetuating because their high wages and astronomical bonuses gives them significant political clout.
The issue here isn't that executives expect to be saved by the government, it's that (a) they don't think they'll fail and (b) even if they do, they know that they get to keep all the money they made during the boom. Thus, dangerous behavior is rewarded, and this behavior costs taxpayers a bundle even if most of that cost isn't in the form of direct bailouts to the banks themselves.
Which brings us to the second problem: a banking crisis does cost a tremendous amount of money even if it's not mostly in the form of direct bailouts. The long-term cost of the 2008 crisis has been huge, but it comes largely in the form of lost economic growth, rising unemployment, and staggering additions to the federal deficit. This cost is borne almost entirely by taxpayers, not by players in the financial industry itself — which has recovered quite nicely, thankyouverymuch. And while it's not possible to say for sure how differently the financial crisis would have played out if we'd had lots of small banks failing instead of a few big ones, I think you can make a pretty good case that the systemic damage came mostly from the crash of the big banks and the shadow banking sector, not from failures at smaller FDIC-insured banks. But those big banks didn't have to pay much of the price.
So: the problem isn't that Wall Street bankers knew they might fail and took risks anyway in the knowledge that the feds would bail them out if the worst happened. The problem is a little more subtle: they're incentivized not to care if they're taking dangerous risks because (a) they get to keep all the money they make during the boom years and (b) they know that even a massive financial crisis will cause them only temporary pain, with most of the cost borne by the broad public which suffers from its aftermath. That's a great big dollop of moral hazard even if, technically, the government doesn't lose a dime on any of its direct bailout programs. And the problem is much worse and much bigger at big banks than at small ones.