What if bees sting you just so they can die?

Well, they don’t do it to die, they do it to defend the hive, and the loss of a couple of workers is evolutionarily worth it.