I don't think it's a regulation bug to require a study to approve a drug for a certain use.
The bug is that we don't incentivize funding expensive studies to discover unpatentable (i.e. cheap) treatments.
The minimum "patch" would be that the governments of the major drug markets decide that effort and discovery of applications count as a basis for patents. Then a drug maker could fund their studies based on which drug candidate is the most promising, not which is the most promising but also novel and thus patentable.
Much better, would be to have the governments presiding over the major drug markets get together and create a proportional fund to cover studies for the public's benefit. The economics of that would be similar to private companies, but at least the profits would go towards further research.