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

Note that in Canada, many of the “flagship” and other universities are in heavily populated metro areas, so that many students can live at home and commute (and many do), even though they also have dorms for students coming from sparsely populated parts of the province or country where there are no nearby universities.

There are some US states like Arizona that have similar population distributions that allow having just a few universities to put a very large percentage of the population in commuting range.