If Apple knew it could make more money in say for example, arms dealing, wouldn't it be obliged to pivot to serve the shareholders? I guess it's somewhat democratic as shareholders could vote against it for moral reasons
No. The common refrain of "but publicly-traded corporations have to maximize shareholder value" is a myth, not a law.
There are bits in the law about management having a fiduciary duty to shareholders, but that mainly means that they aren't supposed to be stuffing their own pockets at the expense of investors. There's a wide birth for management to decide what kinds of profit are and are not worth it.
It’s never just about “more money”. It’s about time-discounted, risk-adjusted “more money”. Doing morally repugnant things increases risk substantially. This is not the risk profile the owners signed up for.
This change may even depress the stock price directly as disgusted owners sell (this harms the ability of current shareholders to earn a return, as the loss is now but the future revenues are discounted).
The market is as moral as its shareholders, which is far less than perfection but a lot better than zero.
I'm all for pointing someone to the sources, but let's not instill the idea that consulting Wikipedia is doing substantially more diligent research than looking at memes.