Because the USA pays massively more than anyone else for its medicine, it's logical that the USA has more pharma industry, producing more medicine, than anyone else.
But because the US Pharma industry is profit-driven, as TFA says, it is interested in making only profitable medicine. And as TFA says, curing things may not be profitable.
If the USA adopted socialised medicine, would we see less drugs but better outcomes? Would the pharma industry get more spread out, and less focused on making vast piles of cash in the USA and more focused on actual cures for everyone?
Put it like this: does a hypothetical Indian biochemistry genius with a passion for solving hard pharmaceutical problems work on some interesting but tricky disease in India that could save millions of lives, or do they go to the USA to earn lots of money creating expensive drugs for not-so-many rich people that doesn't even cure them?
In any case, the basic research behind >90% of US drug inventions is publicly-funded, with private companies productizing this research and reaping huge profits:
>This report shows that NIH funding contributed to published research associated with every one of the 210 new drugs approved by the Food and Drug Administration from 2010–2016. Collectively, this research involved >200,000 years of grant funding totaling more than $100 billion.
Expensive treatments only seem bad when they're just about within reach then people pour all their money into it. Normal people just get old and die because there's nothing available to save them at any price.
It's a bit of both in my country with free healthcare because some treatments aren't funded by the government so poor people just die or endure the chronic condition while those who can afford it have the option to pay full price like those unfortunate Americans.