That's just a shitty pharmacy. Walgreens tried to do the same thing to me and that's why refuse to do any business there. The local chain I use now is pretty good about helping me find the cheapest option for prescriptions (sometimes there are rebates on branded drugs that make them cheaper than generics).
Also, Walmart has a decent list of $4 medications: https://www.walmart.com/cp/4-dollar-prescriptions/1078664