My impression is that the cost of the final clinical trials account for a large part of the expense of bringing any single drug to market (but on the other hand a lot of other drugs fail before clinical trials) (some people think clinical trials are even 90%: https://www.manhattan-institute.org/html/stifling-new-cures-... ; see https://news.ycombinator.com/item?id=10752639 for some disagreement with this figure). My impression is that the general tendency is for the government to focus more on funding the less expensive but more risky earlier stages of research, and for companies to focus more on funding the more expensive but less risky (but still rather risky) clinical trials.
So the conclusion is that in order to do without private funding for drug discovery, the government would have to either (a) massively increase government funding for this, or (b) greatly lower the standards for how much evidence is required before permitting a new drug to be sold to patients (that is, to be content with companies selling a drug to patients, and billing patients/insurance companies/the government, without solid evidence that the drug actually works). Imo either or both of those may be a good idea; but those would both be huge systemic reforms and hence are unlikely to occur, and in the meantime we do in fact rely a lot on industrial funding to bring new drugs to market.