I agree that actions motivated by genuine concern for others are thereby more virtuous than actions motivated by petty reputational concerns. But I don't think this is any reason to hide one's philanthropic activities. Here's why:
Just as some people may give publicly for petty reasons, so one might choose to remain anonymous for petty reasons -- e.g. fear that others might consider one a braggart. In fact, someone motivated purely by altruistic concerns would be quite vocal about their philanthropic actions, since this is how they can help others most, as Peter Singer points out:
One of the most significant factors determining whether people give to charity is what others are doing. Those who make it known that they give to charity increase the likelihood that others will do the same.... We need to get over our reluctance to speak openly about the good we do. Silent giving will not change a culture that deems it sensible to spend all your money on yourself and your family, rather than to help those in greater need – even though helping others is likely to bring more fulfilment in the long run.
There may be special cases where having your name attached to your donation might have bad effects, e.g. placing the recipients in your debt, such that they later feel undue pressure to acquiesce to your requests. But even in such cases, one can be open about the general fact that one donates 10% (or whatever) to effective charities, even while one remains reticent about which particular donations one has made.
Of course, real people aren't angels: we're always going to have some degree of mixed motivation. So it's all a matter of degree. But the less we obsess over our own (real or apparent) "virtue", and the more we attend to real needs and opportunities out there in the world, the better. And that means doing what we can to promote a "culture of giving", making it easier for people to act on their philanthropic values.
So, on that note, I heartily encourage any philanthropically-inclined readers to join Giving What We Can, and encourage their friends to do likewise!