Now, what actually costs money is getting your spine surgery at Stanford rather than the outpatient clinic which costs more than getting physical therapy. It takes a person (often a doctor) to help guide a scared patient towards the most effective option, not the most expensive one. We, as patients, are not experts, so we choose the expensive option as the best proxy for quality. Computers can't engage in a meaningful discussion.
They can be affordable but the problem is largely because of the large number of law suits hospitals might have to face, and plus the cost of buying those technology. Then you go with drugs. Those are expensive. Regulations, license, those are costly too.
And salary too, very high. One might argue that doctors deserve to be paid more if they can do the job properly, saving people's life. I won't get into that, but unless you can cut drug $$ down, salary down and law suit down, or at least two of them, you won't get very far from affordable healthcare.
You might ask why isn't Chinese medicine expensive.
Which countries are you talking about here? (I agree with your general sentiment, though.)
You can get there either by lowering the pay of health care people, or by making them more productive per humman-hour, eg via automation or just better business practices.
I live in country where the cash cost is basically zero, yet I consume as little health care as possible due to the high second cost. In fact the times I do need health care I often opt to pay more up front to avoid as much of the second cost as possible.
As long as you keep the second high enough the demand for health care won't go to infinity even as the first cost goes to zero.