Make sure your seals are tight. Many companies will offer replacement seals. Otherwise your at the mercy of nature. When i encounter ants in my cam i just blow them out with a can of compressed air and they usually don't come back.
Try a little bit of Andro ant blocker. They will eat it and die, what is left over, will eventually melt and repel ants. Do not put on lens, because it leaves an oily residue.
I used to have terrible ant problems with my cameras. I started using ant granules around the base of the tree and sprinkle a few on top on the camera and crotch of the tree if there is one near the camera. It comes in a cylinder style canister and cost about $6 at Walmart. One canister will last about 2 seasons. I have not had 1 ant in any of my cameras in the last 5 years using this method.