Going only by TOS, not the comics or novels.
OF all the enemies Kirk and crew faced, which was Kirk's greatest foe?
1. Khan: easily took over the ship, came back 15 years later, thoroughly insane with a hijacked starship and the Genesis torpedo. Blew holes in the Enterprise, killing some crew and did kill Spock or at least created the circumstances for Spock to sacrifice himself
2. Squire of Gothos: basically a precursor to the Q, imo. Also there is a novel that reveals he is indeed an adolescent Q. All that cosmic power, can move planets and seize the Enterprise, but also a juvenile
3. NOMAD Probe: can wipe out star systems, thinks all life is imperfect. Mistakenly thought Kirk was his creator which led to Nomad's destruction.
4. V'ger: basically an upgraded Nomad probe concept but was quite deadly and also had an adolescent mindset
5. The M5 computer: controlled the ship, could have shut down life support and killed them all, did destroy one starship in the war games and damaged the other 3
6. Commander Kruge of Star Trek 3: willing to fight Kirk on an exploding planet. Takes some guts and insanity to do that.
7. Harry Mudd...a conman with a lot of resources and chicanery. Was considered a suspect by Spock in the abduction of Kirk's body in the Shatnerverse novels. If Mudd gained control over all those androids he could have had an army to use at his command.
8. The Doomsday Machine: came from outside the galaxy, true purpose unknown (read the TNG novel Vendetta)can blast apart planets, indestructible hull, a few blasts from it can take down a starship's shields and a few more blasts leaves the ship a crippled wreck. stopped only by riding a fusion bomb into its gullet, possibly could be reactivated and there may be more of them.
To me his greatest foe is indeed Khan.
Ben Finney was Kirk's greatest foe.
It took Samuel Cogley to get Kirk's ass out of the fire that time, and also it was an extremely stressful situation all round for poor Kirk.
Kirk can cope with ship battles, fistfights, and any command situation. He can have foe's who are a challenge but he is premiere league himself, he doesn't have his heart ripped out.
But to really hurt Kirk, take his power over a situation, accuse him of things he never really did but without any ability to show he is innocent. That will destroy most people and Kirk nearly went down for Finney's murder. Although to be honest how on Earth Finney planned to leave the Enterprise and remain hidden long enough for Kirk to face any kind of prison sentence is beyond me.