My Setting
First of all, let's define what a very advanced transhumanist civilization is in my setting:
1- Post-scarcity civilization (Kardashev level II or even III) where everyone has abundance in their needs from food and energy. People live in orbital stations so even the scarcity of living space is non-existent.
2- Very advanced AI with robots that do all the work that we now do, so people don't have to work anymore.
3- Aging problem has been solved, and people are quasi-immortal.
4- Citizens are transhumans enhanced with genetic-engineering and AI implants. (Will be discussed more below)
Background
In almost every sci-fi setting I have come across, and no matter how advanced the civilization is, there is some kind of fighting/war and we use our imagination as best as we can to imagine advanced weapons and military equipment. This, in my opinion, is due to a very flawed logic of extrapolating our current psychology which is mostly of violent and self-centered nature. This is of course appealing to us now because it relates to our emotions and makes those sci-fi interesting, but is this a really realistic view of our future?
Our current human brains are optimized through evolution for our survival and reproduction to allow further propagation of our genes. Consequently, any action that increases our chances of survival and reproduction as a species is rewarded by our brains and any actions that decrease those chances are punished. This is done by our brains by two mechanisms. 1) The Pleasure-Pain axis, which gives us pleasure upon doing something that increases our inclusive fitness like eating, having sex, being part of a group and ascending a social hierarchy (by resources accumulation and dominance), and pain upon doing things that decrease our fitness like harming ourselves, being expelled by our community and descending in our social hierarchy. 2) The Hedonic Treadmill, which ensures that we quickly return to a relatively stable level of happiness despite major positive or negative events or life changes.
It can be seen that those two mechanism easily justify our violent and selfish nature. Violence and selfishness assured the survival and reproduction for the fittest in a resource-scarce environment. Wars, regardless of their reasons be it resource acquisition, ideology or other reasons all fall under the effect of the pleasure-pain axis and are repeated because of the hedonic treadmill.
Problem
So what does what I described above have anything to do with the question? Well, because of all of the points I used to define a very advanced civilization with, transhumanism through genetic engineering seems to be the closest one that we should be capable of. This can be clearly seen through CRISPR and designer babies. And yet, we are still ignoring genetic engineering potential effects on the psychology of future humans.
The transhumanist David Pearce gives a huge insight into this through his Hedonistic Imperative, Abolitionist Project and Super-happiness. In short, he argues that in the near future and through genetic editing, we will be able to abolish suffering from sentient beings and edit our genes to allow us to live with information-sensitive gradients of well-being by raising our hedonic treadmill set-point. David calls this "paradise-engineering".
You do not have to completely agree with David Pearce to agree that our violent, jealous and self-centered nature will be something of no use in a post-scarcity society. In other simple words, why would a entity (a person or a state) need to fight another entity if both are superhappy, superintelligent and living in a universe with practically unlimited abundance?
Even if the reason for wars emerge from ideological differences, according to the pleasure-pain axis, wouldn't it be much more rational to just ignore each other or even split into two groups and continue living in their man-made bliss?
Question
Having described the above setting in which it is very plausible that genetic engineering will abolish our tendency to violence in an advanced civilization, why would this civilization still need to have a military and wage wars?
The question rephrased:
Why would we choose to keep our satisfaction and well-being of life dependent on the environment (through violence and war) when we can use genetic engineering to create much happier beings in a man-made paradise who can still function like us now through gradients of well-being?