It's not like corporate executives have carte blanche to make these decisions. They report to the board, who represent the shareholders, to whom they have a legal duty to maximize profits. The entire construct is set up to promote the alternative to building the next Bell Labs.
They don't have a legal duty to maximize profits, they have a legal duty to represent the fiduciary interests of the shareholders. If the company doesn't make as much profit next quarter but it will be healthier in the long run for it, that is perfectly OK.