A lot of people forget that "Gene's vision of a perfect humanity where everyone gets along" is a legend that started after the show went off the air. The characters in the original series were not like that, so their behavior can seem shocking. They were good people, but flawed, arrogant, and yes, even a bit racist. But that's what makes them so interesting, even today.
This is an incredibly salient and important point to remember.
These were NOT 23rd Century men in space, they were mid-1960 White Anglo culture in space, and they were real, and an accurate reflection of themselves and their culture of that time,.. The men openly chased the women, and punched each other out, got drunk, and talked about honor,.. and they DID NOT walk around the bridge on egg shells because Uhura was "other than caucasian", and Sulu's hobby was flowers.
So, trying to make STAR TREK out as some sort of utopian vision of the future, is total nonsense (as the above poster pointed out),... is was what it was: Mid-1960's American culture in Space,.. talking peace, while all the while zapping all that opposed the UFP agenda, one way or another. by hook or by crook,.. just like the war at the time.