But the lesson you should take from this is not “we should just deregulate it a bit and hope the free market takes hold.” This is the planned system we designed in one of the most capitalist countries on earth: it got to the state of being a planned system because the truly competitive market systems kept failing. I’m not sure where you can go to find a truly competitive system that isn’t in some way underpinned and supported by the government (and the US government specifically.) People often point to third world countries where they can pay cash, but I think that’s mostly just rich US people buying luxury healthcare at lower prices, not a real working free-market health system that delivers broadly-shared results.
You have to entertain the hypothesis that when the ideal “free market system” exists nowhere, the reason is because the free market system was tried (here in the US, even) and it worked so poorly that it was replaced with one of the systems that survived. Because that’s the pattern we see everywhere with healthcare (and with roads and fire departments, too, outside of a few exceptions.)
The pharma investment problem is a problem, but just to be clear: it’s a question of financial allocation. There are many ways to solve it that aren’t what we have right now.