Those sectors you listed are actually among the least-capitalist and least-free-market in many locations.
They typically involve widespread and extremely invasive government interference that leads to significant inefficiency, service quality problems, and pricing distortions.
The healthcare industry, for example, is highly regulated in most jurisdictions. This eliminates most (or potentially even all, in particularly socialist systems) competition, which in turn eliminates consumer choice and also eliminates the incentives needed to ensure everybody involved behaves efficiently.
The housing industry is also highly regulated in most jurisdictions, and especially in urban areas where demand for housing can be highest. Restrictive zoning regulations, overzealous development review processes, unrealistic building codes, and financial system regulation result in a variety of market distortions that in turn can negatively affect the supply of available housing, the type and quality of housing that is built, rental rates, and purchase prices.
The education sector has perhaps the most government involvement of the examples you gave. In many places, it's provided directly by the government itself. Even if private options do happen to exist, they're often subjected to government-imposed accreditation and curriculum restrictions that neuter their independence. The situation can get particularly bad once government funding gets involved, especially in higher education, which can introduce severe tuition pricing distortions, inefficient use of resources, and so forth.
When a so-called "market failure" occurs, it's usually because there isn't actually a free market involved at all, but rather significant government interference and other socialist policies.
Of course government intervention has flaws too. I hope that we can make our government smarter and more effective over time.
Markets like healthcare, housing, education, and transportation tend to be early targets because they're large and widespread markets that are fundamental to everyday life, and thus prove to be very lucrative targets for government actors to exploit.
Sometimes, this government-imposed regulation is then co-opted by non-government actors who manage to further abuse it to their advantage, making the situation even worse.
"Market failure", "protecting the consumer", and similar phrases are simply the fake justifications used to try to make this unwanted and unjustifiable government interference more palatable to the public at large.
Government actors are inherently parasitic; they don't create real wealth, and are only able to siphon real wealth away from those who do have the ability to create it and then use it most efficiently. Thus, government interference inherently results in otherwise-fine markets becoming less-efficient and worse off, leading to what is then wrongly misinterpreted as "market failure".
The healthcare, housing, and education industries are some of the most highly regulated. Which came first, the market failure or the regulation?
Standard Oil had a monopoly in the oil industry, so antitrust became a thing.
There was information asymmetry around food and drugs, because there's no way for a consumer to really know what's in a food or a drug. So the FDA mandates that they put out accurate info with penalties for incorrect info.
Information asymmetry and moral hazard led to 2008 financial crisis, which then led to Dodd-Frank reform
Once we stop motte-and-baileying this, then we can have productive discussions that identify cases where market capitalism actually does work and then fortify the cases where it doesn’t.
There are obvious cases and many non-obvious ones.
To make an exaggerated point: Medical research is not too far off from throwing things at the wall and seeing what sticks. A lot of working therapies and drugs aren't as well understood as one would hope.
Also it's incredibly complicated. I'm thinking of preventative measures, psychosomatic symptoms, rare conditions, varying sensitivity, long term risks and so on.
There's just no easy answer to any of those things.
In a perfect world, you'd have the social control by families and communities combined with the expertise of health care professionals that determine where the line is on a case by case basis.
Well said, 100% this. It's also worth noting that so many things that one might abstractly think of as matters of life and death are being provided by the current system on a "sometime in the next several months if you're lucky" basis. There are surely some aspects of healthcare that can never really have a functioning market dynamic, like emergency care. But the vast majority of medical care is provided not at the speed of cardiac monitor beeping, but rather at the speed of scheduled appointments and billable events. What we really have is one big market failure due to criminal behavior of "insurance" companies (price fixing and restraint of trade) as well as providers (collusion and extortion). No matter who may be ultimately paying, two critical first steps to restoring some patient agency are outlawing "insurance" "networks" and outlawing post-facto billing shakedowns.
Capitalism is amazing except for where market failures occur, which is many cases. The industries that suck the most also have the most market failures: healthcare, housing, and education