But you forget a remarkably important point.  The US pays for most medical research, which benefits those countries immeasurably.

Some countries fix drug prices for drugs developed and made outside of their country (like the US).   So the US Pharma companies have to recoup that money somewhere...from you and from me.   Same for medical imaging devices, other tests, thousands and thousands of expensive items with long development cycles.