It's a fiduciary duty, not a legal one. It's an expected act, but no law says they must maximize profits at any cost.
Its an expectation that can be changed and tempered like any other, but the rich class doesn't want to own up to deciding to destroy people's lives for their profit, so they hand wave and pretend like someone made them do it.
Maybe a few more bullets will debase them of this clearly reckless belief.
Counter example: Apple spends millions on improving accessibility for the blind that outstrips the profitability of that subgroup. They were never sued for that action. Additionally they didn’t sue the maintainers of Android for wholesale copying their implementations. It’s a bit more nuanced, mate.
You can sue anyone for any reason in the US. It does not mean you will win.
That's also a civil action, not a criminal one. A disagreement in contract law, i.e not something that is illegal.
The actual fiduciary duty executives have is to be beholden to their board and shareholders. They can still decide to make long term and humane choices in guiding their companies. That is their remit, they all just pretend not to have it so they can kill people and destroy lives for personal profit.
While that has happened, companies definitely don't need to make money at all costs, they absolutely can take the values of their shareholders into account.
They can be sued if they act contrary to their shareholder agreement, articles of association, or other conditions made before the shareholder gain a stake. There is nothing that requires a health insurance company to protect profits by denying 30% of claims. There is nothing requiring a company to focus on short-term profitability at the cost of damage to its reputation in the marketplace, or other negative consequences that could arise from attempting to maximize profitability at all costs.