Even in the TNG Writers Bible.
Gene Roddenberry, in the series' original
Writer/Director's Guide (the "bible") was
very specific on the subject;
While StarFleet does have a Military Duty when the time comes, it's not a 100% pure Military Organization.
That's why I call it a Hybrid Service Organization.
It has Military in it's operation & responsibility, but it isn't full Military All the time.
It has other priorities that take precedence when not in combat mode.
It doesn't mean StarFleet doesn't have the Military aspect, it sure does, but it's more than just that.