Of course we do. A lot of the foundational research happens at universities, funded with taxpayer money in the form of research grants.
> They're paying a negotiated price that depends mostly on how much value the drug provides to the patient and the health system.
Only partially. The pharma companies roughly know how much it cost them to get the compound past all the trial stages and how many compounds failed along the path. The usual method is that the rich nations pay for R&D amortization and poor countries pay at-cost for manufacture.