This is where prizes come in. If you create a drug and keep it secret, the government can grant you a large prize as an offer to reveal your secret.
This is a much better compromise. The company will end up with more money(and faster!) as a result of this prize than under a patent system - since the patent system induces dead-weight losses, and the government will end up with more lives saved.
That is just an inefficient way to spend taxpayer money than straight up paying researchers from the government’s accounts.
The US has an enormously large higher education system with all the expertise and manpower to facilitate large trials of novel medicines. The only thing missing is political will to spend the money, so instead, Eli Lilly or Novartis or Pfizer etc spend investor’s money to do it.
And then taxpayers pay for it in a super convoluted way.
Prizes pay for working results. Grants pay for possibilities. Grants are therefore riskier, and thus we allocate less resources to them.
Since the people with the money don't understand the science, these possibilities must then be assessed by bureaucrats, and this causes our best to spend half of their time writing proposals instead of working and researching. A complete waste of time. Let the people who know the most about their subject freedom to take risks, and then they are given the spoils of their rewards if they are proven correct.
Prizes are much more efficient than grants. Prizes should be given to academics according to the value they produced. I have no issue if the academics choose to spend some of the windfall profits of their prizes on trials.
> https://en.wikipedia.org/wiki/Innovation_prize_model