Your analogy makes no sense. Modern medicine didn't create, or even encourage the creation of, the coronavirus. Price gouging is very much an obvious consequence of unbridled capitalism.
However, laws against price gouging are not the whole solution.
Laws against price gouging do not prevent hoarding or panic buying. Thus, holding the price of the goods artificially low in the face of increased demand leads to shortages. (Unsurprisingly)
If you have laws against price gouging you need to have laws that limit the number of units purchased to reduce hoarding. Otherwise, you inevitably will have short term shortages.