Social behaviour doesn’t imply intelligence, or at least conscious intelligence. Most ants will never reproduce. Their life has no meaning beyond the wellbeing of the colony. It make sense that what is statistically optimal for the ant is social behaviour.