Part of the problem is people look at unit price, not consumption.
A cheaper 'generic' Paracetamol might look attractive to some, but if it crumbles easily then you'll get more rejects, both in pharmacy and at the bedside. You see, nurses need to know how much of a drug is administered, and a crumbled tablet isn't a known dose any more, hence the tablet has to be returned to pharmasy and a replacement issued. This can result in the 'cheap' generic tablet costing more per dose administered.
It isn't just the tablet crumbling, either: I had a tablet brought to me pre-operation where the coating had started to melt. The nurse took it away and got a replacement because the tablet would have started to disolve too soon, meaning I would have gotten the wrong dose. As it was part of the anaesthetic...
But some don't see it like that. They see '100 tablets for x, nearly half what we pay, so it has to be value for money!'.
As for companies ripping off the NHS... yes... when you get to compare otherwise identical stationary catalogues, one for the NHS and one for private business, then you see how much the NHS is being ripped off. Same for workmen: We've had quotes for work which were suddenly doubled when they realised they were dealing with the NHS... so why wouldn't we see the same with drug companies?
(Yes, I do get to speak to pharmasists, and one told of how she provided her board of directors the proof that the branded version of paracetamol was actually cheaper than the cheaper generic brand they were using simply because they had too many tablets returned due to crumbling. Fortunately the board paid attention and allowed that pharmacy to swap back to the more expensive, but also more reliable, branded tablet and saved the trust quite a bit of money.)