> so how is this insurance company getting away with what they're doing?
It's not the insurance company, it's the drug company. The insurance companies are probably livid about the extra costs they're having to cover.
The answer to "how" is a variety of different techniques, including changing the formulation slightly (http://www.nytimes.com/2014/09/16/business/new-york-files-an...) and outright bribery of competitors (https://www.washingtonpost.com/opinions/pay-to-delay-pharmac...).