It isn't illegal. And even if it were, the key question is over what timeframe is profit maximised.
Next quarter can be made far more profitable by taking short-term actions that destroy future customer, employee and supplier goodwill. But that just digs a big hole for future profits.