This is an interesting question, and more complicated than you might think. Ants (at least some species of them) move the bodies of their dead comrades to a rubbish pile away from the mound. I think most entomologists would see that as a practical instinct for hygiene.
Ant colonies do have some pretty sophisticated behaviour, like being able to quickly find the shortest path to a food source. However, it turns out we can easily reproduce this behaviour with a few lines of code following very simple rules. For example, as ants walk along, they lay down pheromone trails, which fade quickly. Perhaps 90% of the time, an ant will follow the strongest pheromone trail it encounters. The other 10% of the time, it will strike out in a random direction. As soon as the ant finds food, it returns to the colony. Now, suppose the ants are currently using two different paths to the food. The path that is shortest will tend to have the strongest and freshest pheromone trails, because the ants that go that way will return more quickly. So more ants follow that shorter path, which leads to an even stronger and fresher pheromone trail. Soon the longer path is abandoned.
Similar, other ant behaviour can be explained in terms of simple rules. That leads many people to conclude that there's "no one home" in an ant's brain, that an ant is a sort of mindless robot. A brain that can host a mind is a complicated thing to evolve; we wouldn't expect it to evolve if it was unnecessary. Interestingly, some have suggested that if there is any conscious awareness, it's at the level of the colony, not the individual ant!
So all of that would seem to suggest that ants don't grieve because they aren't conscious in the way a pet dog or cat is. But that might not be the end of the story. It seems like the more science learns about minds and consciousness, the more species we admit into the privileged circle of "mind havers". And recently there was an interesting paper that seems to indicate that insect brains could support some type of awareness. If true, that doesn't answer the question of whether or not insects have emotion, but it makes it a bit more plausible that there's "someone home" to experience emotions.