Bees need to defend themselves against other insects. The stinger doesn't detach when the threat isn't great enough to warrant suicide.