So this thread has gone on for 40 pages, and something that hasn't been brought up yet, and in fact is rarely brought up in these discussions in general. That's the fact that there is a civilian space exploration agency in the Federation, or at least in the 24th century. I'm talking about people we see in such episodes as Who Watches the Watchers, Devil's Due, A Matter of Time, Realm of Fear. The guys we see wearing the gray jumpsuits throughout TNG are clearly non-Starfleet, are unarmed, but conduct exploration on planets, even make contact with aliens, or observe the pre-warp ones. They usually lack rank structure, most of the ones use either Doctor or Professor for their titles. True, one of them was a Lieutenant, but as pointed out earlier active duty military officers are part of NASA, so maybe this guy was a Starfleet officer on detached duty. Actually, considering in this episode (Realm of Fear) they were using a Starfleet science ship, and he was the chief engineer, so likely when Starfleet loaned them the ship, a Starfleet engineer was assigned due to his familiarity with it
But anyway, there you have it, a Federation agency dedicated to exploration that truly is non-military in a very real and literal sense. And these guys don't seem to have any responsibilities outside of exploration, research or other science related duties. These guys are more of a 24th century NASA equivalent than Starfleet. Starfleet after all also has defense obligations, as well as general policing of Federation space, patrolling the borders, and oh yeah, fighting wars. Considering there is a civilian agency that conducts space exploration in a manner not remotely military at all, does this not lend credence to the idea Starfleet is indeed military?