The exorbitant costs arose with the provision of private medical insurance in the 1940s but only really took off when Medicare and Medicaid came in the 1969s with, essentially, a blank check for cost.
Things weren't improved in the 1980s when emergency rooms were required to provide care regardless on a patient's ability to pay, leading to another perversion that for a significant group of people the only way to get medical care was when it was too late and most expensive.
ACA is just another example of the US government doing stupid.