When the stinger gets pulled out of the bee, the sac with the venom comes out too, still attached to the singer
Attempts to remove it injects more venom.
The life of the bee is worth less than the increased deterrent to animals attacking the hive.
The life of a handful of bees really isn't worth much at all to the hive. So even when there's no longer giant ass bears going after hives, there's not a lot of pressure for the bee to lose the barb.
Edit:
It's also important to remember that evolution isn't just competing against predators/prey. It's competing against competitors too.
If one hive of bees has barbs and worse stings than the one next to it, the one without barbs is gonna get attacked.
So the barbs don't have to be enough to convince predators that honey is never worth the sting, just that this honey is more painful to get than that honey.
Overtime the less painful honey may be pushed out of the local ecosystem. At which point it's just barbed bees, and the cycle might start over again with another way stings are more painful.