See: Dodge vs Ford
It's a bit more nuanced than that. The court held that company directors have to be acting for the benefit of shareholders. They still have wide latitude about how to do that.
The reason Ford lost is because his legal position was essentially "I am king, therefore I can do whatever I want". But you can't do whatever you want. You can't lock the workers in the factory and burn it down with them inside, for example. You need to have some kind of colorable argument that what you are doing is somehow in the interest of shareholders (either long or short term).
The problem for Ford was that he couldn't articulate any reason for how his actions were beneficial to shareholders (probably because the real reason, killing the Dodge Brothers Company, would have been illegal under the antitrust laws of the time).
Done. I doubt Henry Ford had trouble coming up with a fig leaf explanation if that’s all that was truly needed.