Why has the government injected $45 billion into Citigroup (C) rather than simply let it fail? Believe it or not, because of how much it might cost the taxpayer to do so. I know that might sound backwards, but consider the largest bank failure so far, IndyMac.
IndyMac had $32 billion of assets and its failure cost the taxpayer a whopping $9 billion (remember, the government insures customer deposits should a bank fail). Well, Citigroup has more than $2 trillion of assets, which makes it about 64 times larger than IndyMac. While the numbers won't be exactly proportional, if you multiply 64 by $9 billion you get an estimated cost to the taxpayer, in the event Citigroup fails, of a staggering $570 billion.
Considering the FDIC insurance fund stood at $35 billion at last check, you can see the government doesn't have the money to let Citigroup fail. That is probably one of the reasons why they might prefer to provide aid to Citigroup in exchange for an ownership stake. It is conceivable that would be far less costly to the taxpayer to keep them afloat than it would be to let them fail.
Full Disclosure: No position in Citigroup at the time of writing, but positions can change at any time