US drug prices mostly subsidize US drug advertising. The impact of high drug prices on R&D spending after you take this into account is fairly limited.
Also, a whole bunch of research is done with public dollars from either universities, or grants to private companies. Those are then always commercialized by a for-profit company.