this is because of over-regulation. Destroy regulation, i.e. patents, and then then tell me drugs aren't cheap.
But dev a "new" cancer drug and you got your license to print money (lot of people get cancer, a lot is payed by insurance, and people and their loved ones want healing).
Also you probably underestimate the value and purpose of pharmaceutical regulation. Most rules revolve around production quality, scientific soundness, safety monitoring and so on. Come to think of it, the degree of safety in pretty much any drug on the legal market is quite astounding, despite exceptions and accidents.