The only thing that defines a "military" is the state it belongs to declaring it to be one. That's it, that's all. The U.S. Coast Guard, for example, is a military organization because the U.S. Government decided it should be. The Australian Coast Guard is not, because they decided it isn't. Likewise the French and Chinese national police forces (and also the Japanese Tokyo MPD at one point) are also branches of the military, because the government said so. U.S. police departments, while alarmingly militaristic, are not.Well, first of all; it's not a myth. A lot of TV and movie writers get this wrong -- Starfleet is a military, because it's an armed service empowered by the state, it acts in the state's defense when necessary, it has a rank structure and courts-martial, everything that defines a military...
Starfleet is not a military organization; this is pretty firmly established by now. The only real reason for this is because the Federation DECIDED that it is not a military organization and doesn't give it that legal status. Among other implications is that Starfleet officers are not subject to the Uniform Code of Military Justice (or whatever the Federation equivalent) and are therefore subject to local civilian law if they commit crimes outside of Federation territory or on the sovereign territory of a Federation world. For example: Spock wouldn't actually face a court martial for murdering Kirk on Vulcan (the ground is clearly out of Starfleet's jurisdiction), but he probably WOULD have if he'd killed him on the Enterprise. Nor could Starfleet really complain if T'Pau got annoyed and invoked a "Kali Ma!" to rip McCoy's heart out of his chest; Vulcan law doesn't forbid it, and it happened ON VULCAN, so they just gotta deal with it.
Which, now that I think about it, is probably why Starfleet isn't legally considered a military. With all the weird shit that happens to Starfleet officers and ships on a regular basis, their BEING a military would either drag the Federation into a never-ending series of small pointless wars, or would sufficiently undermine the legal definition of a "military" so as to render the concept totally pointless.
And something can be warlike without being a military. Again, it's the legal definition that matters. While police officers can participate in a war, being fired on BY police officers is not considered an act of war.Something can be a military without being warlike.
That's one of the reasons the coast guards of most countries aren't considered part of the military: because for almost anyone but the United States, opening fire on a ship flying the flag of another country would be considered an act of war (Australia has done this a number of times in dealing with pirates off the Malay Archipelago). The U.S. gets away with it because, fuck you, we're the U.S., we'll nuke your ass for breakfast. For most other countries, this would create a major diplomatic incident that would require a huge amount of apologizing and back room deals and reparations to the families of casualties, etc.
Don't get me wrong, there are lots of space operas depicting military forces that operate this way. Starfleet just isn't one of them; they're WAY too self conscious for that, and so is the Federation.
I think the simplest answer is that Starfleet ships use a different type of warp drive than most other people in the galaxy, which explains the "form" part. From TAS we have the Klingons using an "S2 Graf" system which is equivalent but not exactly the same as Starfleet's system. You could easily make the case that Starfleet uses a type of drive system that is actually very uncommon in the galaxy, superior in some ways and inferior in others, but in any case is optimized for their agenda (e.g. highly efficient long range travel that, while not exactly stealthy, does not overly impact the environment they're researching).Look at boats. Look at planes. There are only so many shapes that work, regardless of aesthetics. The physics of propulsion through water or air compel certain shapes to be used. As I said, form follows function.
It could also be a matter of materials. There are lots of different ways to generate a given warp field, and probably Starfleet is using resources native to industrialized Federation worlds; this requires the use of, say, verterium cortenide or some other macguffin that tends to produce more radiation or subspace weirdness than whatever it is the Andorians or the Tellarites are using. Klingon ships probably have the same issues (similar materials) but their warp engines work slightly differently and they can get away with a different kind of design aesthetic.