I feel like you are skipping over quite a few examples in Star Trek as a means of proving your point.
If you look at the trapping of Starfleet, from Starfleet Academy to how ranks work, its still structured militarily. Kirk clearly calls Starfleet a "combined service" because that is what it is, a combined military-scientific-exploration service. Only in *one* line does Picard say explicitly, IIRC, that Starfleet is *not* military. Take the hearings and court martial proceedings we've seen in Star Trek..those are all military based, even down to the hearing bell in The First Duty. There are JAG's in Star Trek, in TMP there's a "reserve activation clause", etc. There's "Fleet Admiral Morrow" in TSFS and such.
In DS9 starfleet is divided into "3rd fleet" etc. Those are military force divisions.
Nation States do still exist as part of United Earth because Geordi was born in the African Confederation.
Sorry.