Tell that to Carl Icahn. Management that puts public good over return on investment is likely to be replaced. The interest of shareholders are generally construed as maximizing return.
Thinking about non-profit vs for-profit as a strict dichotomy is unhelpful. There are plenty of investors who shy away from particular for-profit investments and prefer other ones for entirely non-financial reasons.