There's a distinction to be made between how the schools are organized as business entities and how they actually bring in and spend money.
You're correct that schools organized as for-profit business entities have a bad name and are dying back.
But even state schools and universities that are nonprofits on paper can conduct themselves in ways that are profit-driven in practice.
It's kind of like the Hollywood accounting practices where a movie that has brought in an enormous box-office haul is treated as only breaking even on paper. As long as the numbers line up right, you can be a "nonprofit" where salary and perks for top figures are exorbitant.