Good point, I don't necessarily disagree. But is a lot of the R&D to get around existing patents, rather than build a new thing entirely? In the software world I think we can safely say yes. Regarding medical research I'm not qualified to say. I'd love to hear from anyone with some insight.
Now many drugs are also not as complicated as some people might think, the majority of the work that drug companies do it pretty much see what works for what, however for the complicated stuff that they actually R&D from the ground up the patents might be an actual liability when it comes to reverse engineering when they cannot use the law to enforce it.
As for the money, as long as rich people get sick drug companies will continue to do research, allot of the money for the research also comes from government grants and not from investments drug companies would rather produce drugs for illnesses that affect as many people as possible and drugs that combat the symptoms and not the cause where ever possible if we want to be completely cynical about it because that's what would yield them the most amount of money.
If government and private grants weren't available all we'll get in a cynical world would be common cold and cold sore medicine that doesn't really combat either viruses just prevents us from coughing and treats the sores. And that is almost the world we are living in because drug companies and investors won't be dumping resources into some obscure syndrome that affects 800 people in the US, for that we have the sick billionaires son and the sick nephew of a senator's best friend to thank for.