There are multiple enormous scams going on between insurers and pharmaceutical companies. In one such scam the insurers own the pharmacy benefit managers. In many cases the prices FOR GENERICS your insurer will charge are multiple times higher than Mark Cuban's store. The only way to get a 3 months supply in most cases is to go through the PBM. If you want your med through a local pharm, it'll be the same high price and you'll have to go every month.
In another scam, the pharmaceutical company will offer a coupon for those high-priced, name brand medications you mention, then behind the scenes the pharma company and the insurer make their own deals with money changing hands that doesn't even show up on your insurance out of pocket. But employers and insureds are paying for their scam.
Another scam is when pharma makes a meaningless tweak to one of their patented meds and are thereby able to extend their patent and monopoly on a product.
It's touching that you're concerned about the profits of both big pharma and insurance companies but they are busy fucking you and the rest of us over every day 24x7.