Profit is a strong incentive to optimize. non-profit organizations are under different incentives. They both have pitfalls, they both have advantages.
Health care larger is not a competitive market. Lots of customers only have limited options (i.e. rural hospitals) and the urgency of some purchases don't support competition (i.e. ER visits)
Optimize what? Certainly not costs, since for-profit hospitals have every incentive to push for unneeded expensive operations.
Maybe you’re mistaking healthcare for a market where meaningful competition and information symmetry exists?