Gene Roddenberry once wrote:
Then we have this bit from "The Drumhead":Although the Enterprise is a military vessel its organization is only semimilitary. The 'enlisted men' category does not exist. Star Trek goes on the assumption that every man and woman aboard the USS Enterprise is the equivalent of a qualified astronaut, therefore an officer.
PICARD: Did you ever consider applying to the Academy, going the whole route, apply to become an officer?
TARSES: My parents wanted me to. And then I thought about it. I used to sit under this big tree near the parade grounds
It's the money thing all over again. What are the faithful to do when their sacred texts are inconsistent?
JIHAD! Admiral Ackbar!

I generally assume that Roddenberry's initial vision caused some confusion, but the on-screen evidence seems to be that they have enlisted. Though Starfleet is only semi-military (they don't seem to have the restricted line officer vs. unrestricted line officer distinction at all), it's hard to imagine they don't have enlisted personnel. Even with all the automation on-board, there is going to be a lot that doesn't involve leadership but are going to require human (well, sapient) flexibility and judgement.
Even SG-1s writers had weird stuff happening in a definitely military organization (the U.S. Air Force). IIRC, Daniel Jackson took command of the Prometheus, with no one so much as raising an eyebrow.
Edit: Restricted line officers in the U.S. Navy have technical expertise that makes them valuable in their positions (Scotty, I think), but won't be put in command of a combat unit, while unrestricted line officers (Riker) can be. One novel (The Kobayashi Maru) had Scotty having gone through the courses necessary for command of the Enterprise, probably to avoid the incongruity. There are also staff officers, who have professional careers that are intertwined with their naval careers but aren't just their naval careers, like doctors and lawyers. It's complicated.