In a Star Trek modeled future you do have a militaristic structure that is the origins of the communist society. The other half of the Peloponnesian War was Sparta. Rank was based on power from military skill and courage among the Spartiate caste. These people were trained from the age of 7 and lived in a barracks until they were too old to fight. We tend to view our political systems as based on Athenian society (the popular half of the war) and the their demos. Sparta won in the end.
In many ways Star Trek looks like Sparta with machines filling the role of the helots. The Star Trekkers are very much like Spartiates as they are the elite. You really don’t see much of anything else but the militaristic aristocracy in Star Trek.
It doesn’t have to be that way. The issue is always how you define value in society. Star Trek was scientific knowledge but primarily military discipline leading to power and rank. I see the change coming as intellectual ability, i.e. creativity, as the source or wealth or value. The hierarchy is then a more artistic type hierarchy ranked by popularity and pleasure. That doesn’t work out for fighting Romulans and things but it may well be a more likely structure for galactic level civilizations.