I don't think healthcare is messed up because of liability. I think it is because the historical wage cap put healthcare coverage as a company responsibility, and the system that created has hurt people's ability to be covered. Also Congress more or less directly controls the number of doctors (residency spots) and they have not sufficiently increased the count or removed their abilities.
Companies in the US really began offering health insurance because the War Labor Board ruled in 1943 that insurance and pension funds didn't count as wages, and were therefore not subject to the federal wage caps introduced in 42 I think.
So, we got employer sponsored insurance in large part as a way for companies to give more to their employees than the government otherwise allowed.
There were other factors- insurers liked it because it created much safer risk pools than the general public (where only high users would spend the money on it) and unions supported it because they struggled to keep their own plans solvent through dues.
Notably, physicians were the most opposed to early insurance programs, because it took away some control and pricing leverage from them. Nowadays the fight isn't against people having insurance, but as you say the number of residency spots is a big factor in limiting supply of physicians.