EDIT: Because the problem isn't QC (although that's what its disguised as). The problem is that every other first world country has price controls, so pharma rapes the one economy that allows them to, the USA. Region locking DVDs? Hilarious. Region locking life critical drugs? I don't have words for that level of evil and greed.
But QC is a major problem[1]. Even the FDA is not doing a great job, as that article exposes. I used to be very pro-generics, now I double check what I'm buying and where it's manufactured. Now that might not be the driving force, as you point out, but QC is still a problem and ideally there should be some sort of end-to-end guarantees so users can determine that a specific box of product is safe. And punishments need to be extreme to avoid companies like Ranbaxy (now Sun Pharma) from simply skipping the whole QC-and-actually-making-medicine step.