(Sigh...) How did I know the old "Court Martial" arguement was gonna be next? While there is no doubt in my mind that the "real world" reason they wore Enterprise badges was because the costumers ran out of other badges, the "story world" explanation is stated quite clearly in the book Prime Directive; any repair crew assigned to the Enterprise must wear Enterprise badges to indicate which ship they're working on. Enterprise was under repair at the Starbase during the entirety of "Court Martial", which is why those strangers were so uniformed.
i think you'll find that those guys weren't all assigned to Starbase 11...
trust me, i'm on TrekBBS, we debate this kinda minutiae all the time.
Starfleet's also military because when Leyton tried to take over in "Homefront"/"Paradise Lost" in DS9 season 5 it was said to be a 'military coup' and he also declared martial law following the bombing of the Antwerp Conference.
you will not convince me otherwise. they may be tasked with exploratory missions, but they are CLEARLY the military. it's no different than the Royal Navy or even the USN. hello, CAPTAIN COOK?!