In Errand of Mercy, Captain Kirk says to the Organian council members, "I'm a soldier, not a diplomat," at about 9:20 (also, transcript here). This seems very much at odds with depictions of Starfleet as having primarily a mission of exploration and diplomacy, and with several clear statements in TOS and TNG about Starfleet being very much a non-military organization, some of which have been discussed on this site. It appears that this was very much an official concept, originating with Gene Roddenberry himself. If so, how did a line like that end up in Captain Kirk's mouth?
The United Federation of Planets not a military organization, and it's true that the primary mission of the Enterprise is of exploration and investigation. However, I think it's clear that Starfleet is at least partly a military organization, and the crew of the ships that make up Starfleet as military personnel, regardless of how its Public Relations department tries to spin it:
- The ships are outfitted with high-tech weapons; not just defensive but potent offensive capabilities
- They follow a military command rank structure
- They carry firearms
- They are trained in combat techniques.
What is true, and what would be a more accurate thing to say, is that the Starfleet's military force is not a conquering or agressive force. They are almost entirely devoted to peace-keeping operations, the kind that real-world armies participate in all the time. They exist to support the civilian portion of Starfleet, and the UFP in general, in safely doing their job.
Kirk, as the captain of a ship, is not a diplomat. Starfleet has a whole group of dedicated ambassadors that are trained and selected for their dimplomatic skills; Kirk was selected for his ability to command a ship and a crew, to protect those diplomats during their missions. As a Captain, he's obviously expected to have some basic concept of how to make first contact successfully, and how not to ruin diplomatic relationships with other species, but that is not his job and not where his training lies.
Rodenberry had a vision of the future where aggression and war were things that Earth had grown out of, and the UFP and Starfleet were part of that vision. However, he also clearly had respect for the idea of a well-trained, properly used military force as an instrument of peace and protection. There's no reason why he would not have recognized the need to have "soldiers" protecting the "diplomats" from the dangers of unknown deep space, even in his perfect future.
While "Starfleet is a military organization" is an inaccurate summary of Starfleet's mission, it is impossible to deny that there isn't aren't military components in Starfleet.
Command structure and customs follow a naval (military) tradition.
Ships have extensive offensive and defensive weapons
Chief tactical officer is a senior position and "an evolution of the armory officer position" of earlier times.
When war does break out, Starfleet is the organization that responds.
The difference between a military organization and Starfleet is that Starfleet does much more than being a military. The bulk of its resources are dedicated to science and exploration.
Similarly, though a banking institution employs extensive security measures that are vital to its success, it would be inaccurate to summarize Wells Fargo as a "security company". The bulk of its resources are dedicated to financial development.
There are a few roles in Starfleet that require a "soldier". Chief tactical officer is one. Captain is another.
In reality, captain is a bit of everything, including a diplomat.
Federation, and before that United Earth, Starfleet starship commanders were sometimes called upon to serve as diplomats, whether by specific assignment or by emergent necessity.
Diplomat, Memory Alpha
For example, when necessary, Captain Picard took over formal diplomatic responsibilities for Sarek.
That, however, was only by necessity. Starfleet -- being primarily a non-military organization -- has high-ranking specialists in diplomacy, given the official title "Diplomat". Kirk was (ideally) a diplomat, but he was not a Diplomat. In the context of the Organian council, he was expressing this lack of specialization.
Star Trek parallels earlier exploration eras in Earth history - especially Age of Discovery; when soldiers (or fighting sailors, especially captains or expedition leads) typically were the designated diplomats, especially in case of new explorations - in part, because they were pretty much the person with the highest authority of their sovereign ruler present on the scene.
History is replete with diplomats who were soldiers, or even ship captains or military leaders: James Spens, Cook, Magellan, Cardinal Mazarini, Yermak, Kruzenstern, Bellinsgauzen, Vasco Núñez de Balboa, Coronado, Álvar Núñez Cabeza de Vaca, de Champlain, Bernardino de Mendoza, Pyotr Potemkin, Fyodor Leontiyevich Shaklovity, etc...
Please note that preponderance of Russian and Spanish personas on the list is mostly because that's the history I'm most familiar with. Examples from other countries should be easy to come by. I limited myself to listing the names that I was familiar with already from my prior reading.
With the exception of Mazarini (who was primarily a diplomat and later a stateman), they were all more of sailors or soldiers first, and diplomats second.
Captain Kirk's full declaration is
I'm a soldier, not a diplomat. I can only tell you the truth.
I think this is rhetoric on the part of the captain. He emphasizes that his descriptions of the Klingons are true and that his offer to protect the Organians is also true and not just some lip service. He implies that a soldier takes action while a diplomat merely talks.
Kirk also implies that soldiers are truthful and trustworthy by default and diplomats are dishonest and untrustworthy by default.
The two sentences are Kirk's last try in that particular encounter to convince the Organians of the danger the Klingons pose.