Note that here I'm talking about firing good performers because you have "too many" of them. Firing bad performers because the estimated cost of training them is not justified, I can understand.
The only explanation I found satisfying is that investors heuristically care about profit per capita(ppc) as well as total profit, and employees who don't produce _enough_ profit reduce ppc and thus investment to point the opportunity cost of firing them aligns. You'll make investors happy, which will raise valuation, more than what you are losing from the lost profit. But this is not "rational" in a full information economic sense. It's essentially the company virtue signaling that they are capable to fire if they had to, even at the cost of actual dollars.