I think you're arguing against a strawman. Nobody says layoffs are stupid because they're not a very "nice" thing to do. They say so because the statement "it's a company trying to maximize value" is contentious.
The long term objective of a company is not to save as much money as possible. It's to spend money toward endeavors that generate more money.
If the layoff is because of an efficiency improvement, that's justified - like a factory replacing labor with newer cheaper robots. However, that's not what the tech layoffs were about. Tech companies are basically saying we want to do less work. It's not an efficiency improvement, it's a downsizing of their business activities, and it's not clear-cut whether that's a good business strategy for companies that are wildly profitable and growing.