The quick, nasty one is that the losses were bigger than the money we put in. The longer answer is that not all of the money was used to cover the losses; some of it was used to pay for bonuses and things like that.
But the truth is that if we put in $500 billion, we'd still be about a trillion short. The TARP approach is to basically avoid any kind of major bank failure. But some losses are real and we just have to accept that we had invested money into things for years that we assumed were worth X. But it turns out they were worth quite a bit less - and that 'quite a bit' is gone.
For example, when bad investments are made, you have to make future readjustments. Like with mortgage lending. There was a substantial amount lent out to build homes and remodel them: $11.7 trillion, to be exact. The banks put that on the balance sheet as profit for when it is paid back. But now people are not able to pay it back, so what looked like profit isn't. So in order to balance out that loss, you would have to put money in to cover it, but there isn't enough money being put in to cover the losses.
The current idea is that we take money from those that didn't assume and give it to those who did so that they hurt a little less and we all stay afloat."
NEXT: What happens if the stimulus fails?