I don't agree. If the people who get the peanut butter weren't going to buy through Costco anyway (either the institutional or charity organizations), it'd have little to do impact their bottom line so you undercut your own argument in your last sentence. In fact, I'd rather think that the prison system, for one, would consider strongly their next food purchase contract if they had good feelings toward Costco.
No, it all comes down to lawyers, greed and money. It's been a tragedy for the past 40+ years that businesses would rather throw away rather than give away because of lawsuits. That's why the bulldozers are out there, so no one can pick it out of the garbage and start a class-action lawsuit.