If the layoffs are taking a company which could be stably growing to one which is going downhill - in that case the execs actually hurting their long term compensation.
But i get it, it's like junk food for execs, easy to do, crisp in the action (even if not in the effects). But consumed carelessly its bad for company health
They at least secured management a final big bonus for dealing with that, so management and shareholders cash in a bit on the way down.