All ants originally had stingers, and this is why all primitive ant subfamilies have them. However, some of the more advanced ant subfamilies, like formicinae, evolved to replace their stings with other abilities, such as formic acid. While this may seem like a bad thing, formic acid and other abilities that replaced stings are effective against other ants and insects in their own way.
This is accurate. With the vast diversity of lifestyles exhibited the many species and families of ants, stingers aren’t necessarily too beneficial, either. If I recall correctly, for instance, Atta & Acronyrmex spp. (And maybe the wider Attini? Don’t remember exactly) do not use their stingers for defense.