Thousands of dollars per patient times many different patients and drugs quickly adds up to a substantial proportion of all healthcare spending. Countries with universal healthcare have specific programs in place to move people over to generic drugs for exactly this reason, or at least the UK does - along with policies that intentionally give people less effective treatments if the better ones are a lot more expensive. It's one of the ways they stop costs from ballooning as much as they have in the USA.