While this may be true in a general sense in that most companies have bylaws that does not set out another purpose, and that in theory shareholders could go after a board, and so indirectly a CEO, that does not seek to maximise profit, this is overly simplistic.
The CEO is beholden to the directions of the board. The board has wide latitude to act within the rather wide remit of acting within the best interests of the shareholders (as a group, not individual shareholders). It's generally difficult to go after a board for setting direction that does not outright maximise profit other than by simply voting them out as long as there's some reasoning to justify why it is beneficial to the mission of the company to do something. That might e.g. be to ensure the reputation of the company.
So as long as the CEO acts within what the board wants of them, and as long as the board maintains the trust of a majority of shareholders and aren't outright and blatantly violating the corporate bylaws (which can also specify other priorities than just profit), they can - and often do - decide that other things than profit matters.
As such, blaming the CEO in isolation may not be justified. Maybe the board made him. But the company certainly has principles in the form of its bylaws and the AGM and boards interpretation of them. The just might not be nice ones.