Worker ants are all sister and they don't reproduce, so no problem letting others do the hard work.
The reproductive success of an ant hill is determined at the hill level, so the ants have no evolutionary incentive for selfishness at all.
(Not saying successful communism is impossible for humans, especially at smaller scales, just that evolution is working against it, rather than for it).