There is an issue with some old out of patent drugs that costs a lot despite being very cheap to manufacture, but that typically has to do with FDA certification deciding who can be allowed to produce what, which is also expensive to obtain.
I'll admit that profit seeking would work better* in a society that doesn't have a strong state or other coordinating body, but given that one exists to counterpose our existing system is not reasonable.
EDIT: * In the sense that products might be produced at all. Without a strong regulatory body, the market would be flooded with snake oil medicine and the average consumer would not be able to make heads or tails of things. This is because it's much cheaper to make a fake medicine than a real one, which is what profit optimizes for: the cheapest solution with the highest payoff for the seller regardless of costs not borne by the seller (such as death and destruction writ large).
A point in case is the Hep C vaccine: https://www.medicalnewstoday.com/articles/323767#drug-types-...