The alternative has way, way too much potential for rent seeking. You'll get private interests who connive a way to have the government pay to do the hard/uncertain/expensive part while they don't put in their dime until they're already sure it's going to pan out, at which point they swoop in and claim the full IP monopoly to the detriment of the public.
The second is a completely separate problem from the research. If you have a promising drug that people have been using in other countries for a thousand years but has never been FDA approved, it never gets FDA approved because nobody can patent the prior art so nobody will pay for the drug trials even if no research is required whatsoever.
Two possible solutions are to have the government fund the FDA trials or to give the party who does a temporary monopoly on the drug regardless of patentability. And if two parties offer to fund the trials in exchange for the monopoly, let them bid for the right.