Bees can sting other insects just fine. Also these Bees can’t reproduce, so that seems like an obvious difference.
From the hives perspective it’s a question of effectiveness vs the utility of individual bees remaining lifespan. Being even slightly more effective at discouraging mammals from raiding a hive for honey is presumably worth the loss of individual bees.
Wasps on the other hand lack the wealth of a bee hive so presumably different tradeoffs are worthwhile.