With bees and ants, eusociality is probably so common because of their unusual way of determining sex genetically--females have two sets of chromosomes, one from each parent, but males develop from eggs that are unfertilized and have just one set of chromosomes (from their mother and none from their father). So female bees, wasps, ants etc with the same mother and father are what are called "super sisters," because they share on average 75% of their DNA, rather than just half the way siblings in most animal groups do.
In this situation, it makes a lot of sense genetically for most females to forego reproduction and take care of the queen's offspring if that queen is their full (super) sister. Dynamics in colonies get more complex, of course, since the original generation of workers dies off pretty quickly and the offspring of the new queen arise. Also, a queen has sperm from several males she mated with in her mating flight, so their are transitions in relatedness between the worker bees/ants etc. in a colony as the queen uses sperm from different males over the years of her life.
I'm not sure there's a consensus on how and why eusociality sometimes evolves in animals that don't have this weird genetic system, though. Termites are completely unrelated and don't have this genetic system, for instance, and workers are sterile males and females, not just sterile females (as with bees, wasps, and ants).
And naked mole rats, which are eusocial mammals, are even weirder. Why this works for them is unclear, but they are very long lived for rodents and are bizarre in a bunch of other ways too.
Okay, when do we get naked mole rats for our zoos? Special small mammal habitats would be cool too.