There is a lot of darkness and downbeat moments in TOS that emphasize that it's not a Utopian future where the heroes always win and the ideal solution is always found. One can argue that PD situations often end with the least worst of solutions taken when none of the available choices are any good.
Hmm, that seems rather like real life.
...which makes one wonder why the myth of TOS being "Utopian" ever took hold. TOS is littered with the the three "Ds" of death, destruction
. Aside from assumed medical advances and the opportunity to explore, there's no glorious, gold-paved roads across the stars.
I think a great deal of it is related to context. The '60s were a turbulent time with established conventions being questioned and the threat of nuclear holocaust hanging over people's heads. Star Trek's
very depiction of a multiracial group of characters working together in a far future as they reached out among the stars was in itself a powerful message of optimism. It was made even more powerful because it was shown "this is the way things are" and without over selling it. An analogy would be the depiction of a phaser in use---you don't explain it or how it works, you just show it. Throughout the series it showed the characters wrestling
with preconceptions and bias and personal failings in aspiration of something better. It should humanity as we are trying
to be who we want to be.
And I think this is part of why TOS still resonates after all these years. TOS didn't show us a literal Utopia, but perhaps a comparative one. Strictly speaking it depicted a better but certainly not perfect future.
That said fans picked up on this, interpreted it in their own ways and projected that back onto the show. They repeated these things back to Gene Roddenberry who in turn seemed to try putting a lot of it into TNG. I think that's partly why early TNG can seem a bit pompous because it's telling us rather than showing like TOS did.