Some good points here. I'll give my $0.02, with the caveat that I've spent a two decade career in industry 'R&D'.
First, R&D should really be broken up to understand the process. The 'R', as far is internal research, is often a minor fraction of what an overall biotech or pharma might spend in other areas, for instance advertising. One lazy example I found quickly here, but there are many others. Personally I think allowing more direct advertising of drugs was a mistake...generally. It certainly increased the amount companies spend in that area where they could be spending it elsewhere. That said, I can also think of areas where it's helpful, as once you get out of large cities or 'Centers of Excellence', there's a huge education gap with some physicians when it comes to the latest treatment options. Directly reaching the patients is often a very, very tangible way to improve access to the best treatments available. A topic for another post, perhaps.
'R' is taking an idea - I want to hit Target X - and making it into a drug. The biggest issue is time to the clinic, which does cost money for sure, and many ideas and approaches fail. But in general - startup or pharma - R is fairly cheap. 'D' - taking it to the clinic, approval, and launch - is a money sink. I can think of several personal examples where a clinical trial costs $1mil/patient - and that's just Phase 1 (safety, dosage and pharmacokinetics) or Phase 2 (the first hints of seeing if it might work). Those are 'just' 20-200 patient trials, before you get to phase 3 or 4 when you expand to many hundreds to thousands of patients to really understand the benefit. Clinical trials are massively expensive and no company would invest in them without some guarantee at the end that, should it work, one has some amount of exclusivity time to compensate for the upfront risk and expenditure. There's a debate for sure on how long that exclusivity should be. Note that those patents are for a specific 'lock and key' if you will for Target X. Someone else can come up with another way to hit Target X and make their own drug, so it doesn't hinder development in that way.
A different type of 'R' is when large companies sign agreements with smaller startups who have their own asset, but lack both the $$ as well as the massive, massive clinical and informational infrastructure to successfully take it through clinical trials. Most medium to large biotech/pharmas blend internal research of ideas with strategic partnerships either with good ideas they didn't have, or technology which would be too difficult, time-intensive, and costly to develop internally.
In my 20+ years in large medium and small companies, not once has a drop of my research been funded by the taxpayers. On the contrary, ideas for 'hitting Target X' that have come from academia are very heavily protected by their own patents, and increasingly I've seen much more successful spin-outs from academia, into startups in the past 10 years, and it's steadily increasing (which is a good thing). The public-private lines get a little crossed when we get to the 'D' portion, again in the clinical development phase. A good summary of how this plays out is here.
The patent protections in the US are certainly important to the success and innovation we have, but it's not exclusive. There are similar processes in most of Europe and Asia, and that's why you also see not only top-notch companies and innovation there, but successful clinical development. Most large pharma companies depend on development in multiple areas. That said, places like China and India are the wild-wild west, and while that has not prevented them from developing their own home-grown innovation, it has time and again proven to be a detriment for US/European pharmas from making large-scale investments there, despite the large market.
With all that said, the decisions around pricing can still be head-scratching, and even with all my years of experience I don't understand it, and fundamentally our health-care system is flawed. I know my employers are not altruistic, but in general the business model is completely dependent on ensuring as many patients who can benefit from the drugs I develop get access to them. On the contrary, the insurance companies profits hinge on taking in more premiums than distributing payments. In my current organization, one of our number one issues is trying to get insurance reimbursements. In many cases, it is far, far easier to reach patients in Europe.