That's an often-repeated maxim, but it's not universally agreed to be true.
Quoting https://corpgov.law.harvard.edu/2019/08/24/stakeholder-gover... for example:
"The fiduciary duty of the board is to promote the value of the corporation. In fulfilling that duty, directors must exercise their business judgment in considering and reconciling the interests of various stakeholders—including shareholders, employees, customers, suppliers, the environment and communities—and the attendant risks and opportunities for the corporation.
Indeed, the board’s ability to consider other stakeholder interests is not only uncontroversial—it is a matter of basic common sense and a fundamental component of both risk management and strategic planning."