That's kind of like saying that gravity is a universal excuse for rocks falling on your head.

No, that's almost entirely unlike that. Gravity is well-understood and can be calculated and predicted. Predicting how a public company will behave based on the principle that it's going to maximize its profits is impossible. There's an enormous range of attitudes and behaviors that are used in practice and not considered to run afoul of this principle. This is why appealing to it is a sorta-meaningless universal excuse.

If you look at what actual public companies are doing, you will see all around you kinds of behavior that cannot be explained as maximizing the profits in any realistically predictable sort of way. Granted, for any such behavior you can come up with a plausible story about how it's somehow still going to contribute to profits by, for example, improving the company's public image, or betting on a long-shot breakthrough. But then, you can come up with such a story for virually any possible behavior, so it's, again, meaningless.

Some companies contribute to charity; others don't. Some companies spend huge amounts of money giving to their employees bonuses not mandated by contracts; others don't. Some companies (Yahoo) reject buyout offers based on higher-than-market evaluations - a decision that by definition robs shareholders of profit. Others don't. Some companies pay dividends. Others state upfront that they never will. Some companies follow established net standards when creating their applications. Others willfully break them. Some companies have a privacy policy for their users and stick to it; others have one and ignore it; others don't have one. Some public companies (Amazon, in fact) spend years racking up huge debt and ensuring they won't bring profit to their investors for many years to come. Some public companies (Microsoft) invest in a huge resource department that's poorly publicized (meaning little to no PR benefit) and almost certainly doesn't justify itself economically.

For all that, board takeovers for not maximizing profits, much less criminal persecutions, are very rare, because nearly any kind of behavior, including all enumerated above, can be justified with some sort of appeal to maximizing profits in some roundabout way or another, at some future or present point of time, according to some executive's judgement that's assumed to have been made in good faith. Yahoo's management had a good faith belief that Yahoo is really worth more than Microsoft was offering, even if the marker didn't recognize this. Spending lavishly on your employees is justified by claiming that otherwise the talent will leave and hurt profits; on the other hand, being a real cheapskate with your employees is justified by cutting costs and maximizing immediate profits. And so on and so on.

Given that just about any behavior can be explained as a way of maximizing profits, it's a useless explanation. It usually gets cited in defense of some objectionable behavior that can be seen to maximize profits in some easily-identifiable scope. The fact that other public companies (often) somehow manage to avoid doing the objectionable, or that this company (like just about any large company) routinely does things that hurt profits according to the same kind of simplistic explanation, is ignored. As I said in my original comment, it's a red herring.