Engaging in charity and supporting foundations is not related to the "generosity" of the a corporation (who runs it); charity and foundations can be PR and tax-saving strategies.
Drug cartels engage in charitable donations; that doesn't make them generous.
HSBC (just picked a random one) supports charities. It also launders money for the drug cartels and is generally involved in illegal money transactions.
I can pick virtually any big corporation involved in corruption/crime scandals and I'm pretty sure they routinely make charitable acts and/or have their foundations and as well.
I certainly don't say that any corporation is corrupt, but the link with foundation/charities and morality of a corporation just doesn't exist.