Sometimes you have to grant a story a few points and look at the bigger picture. "Patterns of Force"—in which Kirk, Spock, and Bones beam down to a planet that has modeled itself after Nazi Germany because Starfleet officer John Gill (David Brian) has violated the Prime Directive and intervened—is such an episode.
Here's a show where the outcome of an entire planet rests on Kirk and Spock sneaking around a Nazi base and outmaneuvering the bad guys by using some of the oldest tricks in the book of spy movies. The literal use of the Nazis seems a little on the excessive side; I find it hard to swallow that Gill would incorporate the hatred and racism of Nazism (and even so specifically their symbols) in his attempt to create this "efficient" state.
Nevertheless, "Patterns" works reasonably as a plot-heavy episode with the underlying cautionary tale of interference and the subsequent need for action, both in opposing evil and in setting mistakes right. As conveyed, it's not incredibly deep, but it's workable.