I agree that management doesn’t get much benefit by giving valuable public negative feedback to people. However, I’d push back on the idea that management can “just fire” people they don’t like.
Many managers are middle managers. They likely have a lot of gripes with their teams, but they need to work with someone, and often, it would be incredibly awkward or controversial to fire a lot of people.
There would still be zero benefit to publicly criticize in the case you are describing.