May one invest in corporations whose activities may be ethically wanting? We are enjoined to conduct ourselves in an exemplary way in all spheres of our activity including, nay especially, in our monetary dealings. Furthermore, aiding and abetting the unethical conduct of others is akin to actually committing the "crime" oneself. Thus it would appear that buying stock in corporations that deal primarily in such industries as tobacco, or offensive military equipment, or which engage in discriminatory labor practices or unfair competition would be proscribed.
Torah law, however, only proscribes aiding and abetting if one's actions are a necessary ingredient for the commission of wrongdoing. If the proscribed action would happen with or without your involvement, no biblical law is violated. Rabbinic law, on the other hand, is violated when one publicly associates with wrongdoing, even if one is not responsible for such behaviour.
With this brief (and incomplete) background we can draw several conclusions.
Joining the board or being part of the top tier of executives of a corporation that engages in unethical practices would be forbidden. Similarly, purchasing a controlling or even an influential block of shares - as might be the case with mutual and pension fund managers - would violate Jewish ethics.
The individual investor would be enjoined from purchasing stock in an initial public offering but buying small amounts of shares in the secondary market would be allowed. In this typical investment one is not directly helping the corporation as profits (or losses) on these transactions accrue to the investors themselves. Similarly, investing in a mutual fund where one is often not even aware of what stocks are owned and only indirectly investing in the companies themselves seem to present few moral issues.
However, while owning a few shares may technically be permitted, surely a sensitive person would not knowingly invest in company that, for example, releases cancer-causing agents into the environment. After all, your making money would be tied to the companies' success at carrying out its unethical practices.
As well, though not engaged in "unethical" practices per se, similar standards would apply to investing in, for instance, a Jewish company that operates on Shabbat.
In short, Not all that is permitted is to be recommended.