Why are American universities and med schools so expensive when other countries are doing it right?

In most developed countries, public universities are publicly subsidized. To make matters more complex, there are two levels of public funding in the US: federal and state. The US moved away from the public funding model toward an individual (tuition-based or endowment-based) funding, with a sharp decrease in public funding/increase in individual contribution after the 2008 crisis.
It’s a choice that can be reversed at any time. There was widespread support for public university funding from post WW2 throughout the “baby boom” years.
For instance, when Pell grants were created, they covered the full cost of tuition, fees, room, and board at a public university. Now, often, Pell grants don’t cover even tuition for a commuter at a local public university.
Then again, some costs have risen: cinder block housing with everything nailed down and communal bathrooms is not imaginable for kids who’ve grown up with their own room and their own bathroom (remember when kids shared a room and the whole family shared one bathroom? What was normal then isn’t now.)
Mental health has become a real concern, and accomodations now exist for kids who used to be dismissed as either lazy or stupid. This costs money.
Other developed countries don’t have campuses. They don’t offer housing, gyms, health centers, tutoring. There’s typically universal health care so anything health related is not the college’s business. Classes are sink or swim - there aren’t any tutors. Nor are there functional career centers at many universities (not all).
The university that follows this “use the town you’re in” model is Minerva.
https://data.oecd.org/eduatt/population-with-tertiary-education.htm
Finally, wrt restricting access: this is less and less true. Other countries are catching up or even the US has been caught when it comes to degree holders in the 34 and under group. It’s started to fall around 2010/2011, relative to other countries.
https://nces.ed.gov/programs/coe/indicator_cac.asp
Relevant sentence: " In 2000, the rate of attainment of any postsecondary degree among 25- to 34-year-olds in the United States was 12 percentage points higher than the OECD average; by 2017, this gap had decreased to 3 percentage points."