I don't know of anyone claiming it's a legal obligation. It's a natural obligation, and it's worse.
The shareholders want profit maximised, and with that end, decide upon the board of directors, who decide upon the CEO. If the CEO does not maximise profits, the CEO will not remain the CEO. Therefore, the CEOs of (publicly-traded) companies are obliged to maximise profits – those who do not feel such an obligation are not CEOs.
Hmm. I could argue that technically there're sometimes contracts with investors, but that's not about public trading; they probably just didn't understand where the obligation comes from.
It's odd to claim companies are obligated to maximize profit in a thread about Amazon, whose retail operation isn't profitable and basically exists because Bezos hypnotized investors into giving him free money forever.
The shareholders want profit maximised, and with that end, decide upon the board of directors, who decide upon the CEO. If the CEO does not maximise profits, the CEO will not remain the CEO. Therefore, the CEOs of (publicly-traded) companies are obliged to maximise profits – those who do not feel such an obligation are not CEOs.