Shares in a corporation are a contract(read: agreement) that you have with that corporation and the other shareholders. If you think that donating to a campaign or cause is always wrong, you can seek out companies that do not do that, and only agree to invest in those types of companies. If you think that there should be a rule that any political donations must be approved by a shareholder vote then you can seek out corporations that have that in their shareholder agreement (not that I think that there are currently any in existence).
There are many corporations out there that have a specific 'agenda' that they support with their profits. Some of them are totally ridiculous (see the Trijicon story: http://defensetech.org/2010/01/21/update-on-bible-scopes-us-...), and some of them are worthwhile(Aid to Haiti), but this is my subjective judgement of those causes, and anyone else might view them differently.