I don't think it's reasonable to say that this was given away "for free". If it was "free" then there wouldn't have been any over-recovery at all, would there?
In the CPP, the government bought preferred stock in a number of banks (mostly not Wall Street ones, but whatever). That stock could've been worthless if the banks failed, but otherwise the banks were required to pay an annual dividend of 5% through 2013 and 9% thereafter; plus there was a whole host of supervision of their activities, including limitations on their ability to pay ordinary dividends.
It makes no sense to say "in 2008, the government expected to lose money on the CPP so that's what happened; gift to the banks that was never paid back" and then drop the mic while ignoring what actually happened.
For example: TARP's Congressional Oversight Panel estimated that the $25bn capital infusion into Wells Fargo represented a subsidy (difference between fair market value of the preferred stock and the amount paid) of about $1.75bn.
However, in 2009, Wells Fargo bought back the investment after having paid $1.44bn in dividends. Then, in 2010, the Treasury also sold $840mm in Wells Fargo warrants that were part of the CPP deal.
What we thought would happen: lose $1.75bn. What actually happened: made $2.28bn. If that isn't "paying back" from your perspective, could you please suggest what would be?
Those loans and investments weren't guaranteed to be paid back, the government took a risk.
Assuming risk of loss is a valuable thing that gets traded all the time through futures, options, swaps and other derivatives. Those futures, options and swaps have a cost.
The fact that the government gave away that value for free means it was a massive gift to Wall Street banks.