I think that the description of the ant battle is to bring out Thoreau's basic dichotomy between humans and animals. Thoreau is seeking to bring out the idea that there is an evolution that supersedes both. He brings this out earlier in the work:
I have no doubt that it is a part of the destiny of the human race, in its gradual improvement, to leave off eating animals.
In this idea, Thoreau is seeking to bring out the idea that there is a "base" destiny for creatures and a more elevated and spiritual one to which he believes human beings can aspire. In this, he posits the battle between the ants. His detailed and thorough explanation between the Red and Black ants results with the latter emerging victorious. Yet, Thoreau's reflection afterwards helps to bring out both the futility of battle and how humans fit into this schematic:
Whether he [Black Ant] survived that combat, I do not know. But I thought that his industry would not be worth much thereafter. I never learned which party was victorious; nor the cause of the war.
In this, Thoreau deposits how we, as human beings, function in our lives. Full of "sound and fury," yet signifying nothing. This is something that Thoreau brings out to parallel to human beings in that there has to be some direct and elevated purpose to why we do what we do. If this is lacking, Thoreau argues, we are no different than the ants who battle without purpose and meaning.