Transparency...
Unfortunately, pharmacies and PBMs are both culpable. GoodRx, Mark Cuban, and other initiatives came about because of the pricing dysfunction in the prescription drug market. Generally, it's similar to the pricing dysfunction in the health insurance industry as a whole (high U&Cs with discounts given to purchasers based on their market dominance), but more complicated as drug distribution and the flow of money between manufacturer, middle-person entities, and the ultimate patient is quite complicated. Drug rebates to insurers, patient assistance programs, PBM-owned mail order pharmacies etc.... further obscure the flow of $$$.
GoodRx, etc... would not be needed if existing retail pharmacies charged a reasonable U&C. But they've brought awareness to the issue that is spurring some change, albeit somewhat glacial in speed.
Pharmacies and PBMs need to make a profit, but the convoluted system that's evolved over the decades could never have been envisioned by a sane society.