Markets in medicine suffer from three problems.
One, that the doctor knows so much more than the patient it's hard for the patient to know whether or not he's receiving good care.
Two, that it's not practical to shop around in emergency situations. If I'm having a heart attack I'm not going to drag out the yellow pages and call around to find the best deal.
And three, many people will never make enough money to cover their own medical care. Sometimes because they have some expensive condition, and sometimes because they just don't have much money. While I'm pretty comfortable saying people who can't afford wide screen televisions should have wide screen televisions, I'm not at all comfortable saying people who can't afford and appendectomy should find a comfortable spot to die.
Medicine is an area where the individual patient can very often not provide useful feedback to themselves or others. It is too technically hard because anecdotes can easily fool individuals, even expert individuals.
Adam Smith himself was both a moralist and an economist. He had a nuanced understanding of the topic, and recognized the tendencies of the invisible hand to go the very bad places, under some scenarios.