I've had to lay off a decent number of people over the course of my career. The way I have always justified it is that I'm keeping the company healthy, and allowing far more people to keep their jobs in doing so. I'm sure there are cases where restructuring was done to the detriment of the business. I don't believe I've personally participated in any of those.
That is part of the reason I took those jobs. Someone was going to do it, and I felt that I could do it in a way that kept the business healthy and was as respectful and careful about the humans impacted as possible (ensuring severance, having 1-1 conversations with every impacted person on my team, etc).
For context I was an executive brought in to restructure software companies after they were purchased or tucked in by the LBO side of a PE firm.