But it's certainly true that equity holders came out quite a bit richer than they otherwise would have. Owners of common stock are last in line in a liquidation, so they likely would have gotten very little. But now they've got more equity than at the time of the bailout.
Thus, the government pumped taxpayer money into GM shareholders.
In the bankruptcy, the Motors Liquidation Company purchased all the valuable assets (including the names and trademarks) from GM. The proceeds were (and are still being) used to pay bondholders and other creditors. Anything remaining would be given to shareholders, but the proceeds of the sale are not expected to be even close to sufficient for this to occur (that's why GM went bankrupt to begin with).
http://en.wikipedia.org/wiki/General_Motors_Chapter_11_reorg...