It's partly a result of government in action. Medicare and medicaid keep lowering their reimbursement rates so there's less and less incentive for drug companies to produce certain types of drugs. Companies exist to make money for their stockholders. It would be naive, unreasonable, and unrealistic to expect otherwise. It doesn't make companies cold and uncaring. Business is business. If governments wanted those drugs made they could pay enough to make it worthwhile for the companies to do so.
I found this online
"A crucial problem is disconnection between the free market and required government regulation. Prices for many older medicines are low until the drugs are in short supply; then prices soar. But these higher prices do little to encourage more supply, because it can be difficult and expensive to overcome the technical and regulatory hurdles. And if supplies return to normal, prices plunge."
"More than half the recent shortages have resulted because government or company inspectors found problems like microbial contamination that can be lethal on injection. Others have occurred because of capacity problems at drug plants or lack of interest because of low profits, according to the F.D.A."
"Heather Bresch, president of the generic drug giant Mylan, says the shortages grow out of a sweeping consolidation of the generic drug industry into a few behemoths that compete only on price and have foreign plants that are rarely inspected."
I'm in the same boat, 72 in Jan and take nothing except a Prevacid if I eat anything made with or a lot of butter in it which may be every few months if I'm away from home.I am lucky that at 71 I don't take anything but half of a Alka-Zelser about once every two months.