I think trash collection, indoor plumbing and refrigerators/freezers have done much more to improve the public' health.
For example, the cost of eradicating smallpox was about $1-2 billion (in 2017 dollars), and saves around 2 million lives per year. (This is a rare example of a one-time investment that pays off forever with no additional action on our part, which is pretty nice.) This is about what New York City spends annually to maintain city water and sewer infrastructure.
(Plus those are not medicine, which is the context we were discussing here).