In a free-market approach to drug development, if the expected loss of attempting to develop as drug is negative, and the cost isn't too high, then there is an incentive to develop that.
The best public policy outcome in such an approach would be for losses to be only slightly negative. Positive or zero expected losses mean no drug development, and highly negative expected losses mean the drug is more expensive than necessary and reduces the accessibility of the drug.
However, current patent law allows companies to minimise their expected loss, with no controls to prevent highly negative expected losses.
There are alternative models - such as state funding of drug development. This model has benefit that it is possible to optimise more directly for measures like QALY Saved (Quality Adjusted Life Years Saved) - which drug sale revenue is an imperfect proxy for due to some diseases being more prevalent amongst affluent people, and because one-time cures can be high QALY Saved but lower revenue.
The complexity of state funding is it still has the free-rider problem at a international level (some states invest less per capita in funding). This is a problem which can be solved to an extent with treaties, and which doesn't need to be solved perfectly to do a lot of good.
Excessive profits from patented drugs are controlled by development of competing drugs. These competitors arise until profits are driven down to the point further development of competitors is inhibited.
The US has zero credibility w.r.t making international treaties these days. And generally is completely set up for a few peoples maximum “expected negative loss”. Sure things could theoretically be structured differently, but for the foreseeable future they aren’t.