There are so many options I don't know where to begin . . .
Farming ants work with fungus. Perhaps the fungus releases toxic fumes or happens to be slime like . . . Violet Fungus is normally found with Shrieker fungus, but perhaps a strange variant - non-poisonous to ants (or perhaps the source of their poison, if you make their bite poisonous) is being farmed. What about a Gelatenous Cube in their refuse pit? Transparency, a paralytic poison, acid damage - it could add up.
Some ants herd aphids. Granted, these are herbivores, but then so too are cows - and look at the minotaur . . . Or perhaps a few swarms of Stirges hang about, hoping to scavange from the ants. Add on half-dragon templates (to the stirges - or the ants) and things get more interesting . . .
What about the spiders and other creatures that hunt ants by looking like them? Could be some of those "ants" are not what they seem . . . Monstrous Spiders of Large size could be . . . interesting. Or perhaps some of the "ants" are a variant of Taskmaster Formians (poison sting, domination, etc).
Some ants are poisonous &/or acidic. Perhaps if you gave them a bit of both - a poisonous (paralytic - Dex or maybe Str damage) sting and acidic saliva . . .
What about mandibles of sharpness - severing off a limb (or head) upon a successful critical? Of course, ants - like many insects - can survive for quite some time without their own heads, so returning the favor would only remove the bite attack. Or just expand the crit range of the bite attack to 18-20. That by itself could increase the damage a little.
Some ant species have symbiotic mites attached to them. Some of these are almost graft-like - at least in appearance. In a fantasy setting, this may have more interesting effects . . .
Several species of ants are slave raiders. As such, some of the ants could be of different types - captured and raised since infancy and so loyal to the hive - but with different and perhaps dangerous / useful abilities . . .
A Hive Mind in and of itself could be useful - preventing any ant from being flanked or otherwise susceptable to precision based damage. It would also allow the ants to coordinate their attacks. Perhaps a few of the ants have the Improved Trip or Improved Disarm feat as racial bonuses (as they lack the Int for such normally).
An earth or fire template could work wonders - as could an axiomatic, fiendish , or half-fiendish one. Or perhaps just the queen and the more recent pupae and a few ants have the template - due to the queen herself only recently gaining it. Suddenly those pupae are not quite as safe to be around as priorly thought. What about a Half-Troll template (from the pdf list another suggested)? Fast Healing 5, increased physical stats, claw attacks, rend (should both hit), Scent, and a couple other things for CR +2, Int -2, Cha -2. Perhaps only the queen, the more recent pupae, and a few of the soldier and worker ants have the template, but it would certainly bother your players . . .
As already stated, sheer numbers could be a major issue. Sure the party may only lose a few hp with each encounter, but after 20+ encounters, well, it adds up . . .
If the ants exist in a hive mind with the queen as the central mind, perhaps she has enough power to use psionic or magical effects - such as illusory walls at an intersection after the party passes. If the party loses it way or is not paying attention, they could quickly become lost without realising it.
Eg: The party retreats, intending to take a left at the next fork, but they unknowingly pass the next fork as one passage is hidden in such a way that it seems that the tunnel has continued as normal. The second fork is shortly thereafter, but as they didn't emerge from that passage they were not aware of this - and so they take the left at that fork - and unintentionally move further into the hive instead of out of it.
All this - just from a single illusory wall. They will catch on if it is done too often, but if the tunnels are arranged right, just a single instance may be enough, leaving them to wonder if they had made a wrong turn, unknowingly passed through a suddenly active portal, had a prior passage at an intersection collapse before they reached it, or something else entirely. Being lost in such a dangerous location can be the worst danger yet.