The "not a military" lines in early TNG are, while intended to reflect Gene's somewhat out there vision of an evolved Federation, so obviously wrong in the context of later material that the only coherent way to handle them is to either chuck them from canon, or to treat them as a bit of in-universe exaggeration and semantics wrangling that gets proven completely wrong by the time of Wolf 359.
Ah, the battle of Wolf 359! Were somehow Starfleet failed to evacuate civilians from the exploration ships they sent into battle! Completely reasonable, if you ask me.