Have you heard of e.g. East India companies? Or United Fruit?
Most of stock is not owned by individual persons (not that there aren't individuals that don't give a shit about enslaving people), but other companies and institutions that by charter prioritize profit. E.g. Microsoft's institutional ownership is around 70%.
The presence of unethical people does not imply that all people are unethical, only that people are different. And that's my point. Reducing a company to "they will always maximize shareholder value" is incorrect - for many, many companies that is simply not true.
My point is that in the big picture ethics don't even matter, companies become something that transcend the individuals. Almost like algorithms that just happen to be implemented by humans (and exceedingly machines). There are no "they".
E.g. Henry Ford tried to make an ethical decision for the company to cut some dividends to benefit workers and make the products cheaper. It was ruled illegal. His mistake actually was to say that the benefits would about more than profit; arguing the investment on shareholder profit grounds could well have passed.
Probably safe to say Henry Ford had considerable power in Ford Motor Co compared most executives today?
You're talking about investors and shareholders like they're just machines that only ever prioritize profit. That's just obviously not true.