Are there evolutionary advantages for the bee sting to kill the bee?
Fitness of the colony vs fitness of a single worker

Bees have a division of reproductive labour (they are eusocial). Only a queen reproduce (and the males called drones) while the workers dedicate their existence to ensure the survival of the colony. If committing suicide will be of any help to the colony then one would expect a bee to do so. What I just said is an oversimplification of the structure and mating systems of bee colonies.

You should have a look at the field of social evolution to have a better understanding of what's going on with bees!

What is the cost?

Above I argued why nobody really cares much if a single worker dies. This being said, if the bee survived to stinging, then it could eventually keep protecting the colony as it was doing before stinging. So why does it has to die? Clearly, there must have a cost to not die. It seems very plausible to me (but cannot offer an evidence for it) that there would be a strong physiological cost to create a stung that that would not kill its carrier. Such physiological cost (even if mild) can by large outweigh the cost of losing a single worker for the colony.