Unlike many classic works of sci-fi, Star Trek offered an optimistic vision of humanity’s future — one where democracy triumphs, exploitation is ended, and everyone’s material needs are met.
I mean, yeah, sort of. Very, very progressive for the time. But they had a huge blind spot in the military structure, which is as hierarchical and patriarchal as ever. I am not talking about command and control structures, which are potentially effective, but about the idea that a single captain would run a star ship over long periods of time instead of being floated among different crews that get a chance to vote for their leader.
I wouldn't say the patriarchal or hierarchical structure is a blind spot of Star Trek. They were ahead of their time. But if looking back at episodes from 1960s with today's perspective, it does look dated and weak w.r.t representation of women and minorities.
Men are overrepresented in positions of power, especially in earlier series, but Star Trek has women acting as officers, captains and admirals.
Starfleet's structure is military-like and hierarchical however it's not depicted as a perfect structure. Captains or lower-rank officers regularly break orders, often get a pass afterward when their actions are justified.
Also, United Earth has a civil government, so does United Federation of Planets. The series focuses on the defense/exploration branch of the federation, which has a military structure. But it's not representative of the structure of government for the whole federation.
Rotating leadership in a military-ish context in deep space sounds like the material conditions for the creation of factions and potential mutiny. If getting rid of every hierarchy, even ones you freely volunteer for, is the only way a future counts as positive, there’s no point in writing sci fi. Ordinary citizens in the Federation aren’t in a military hierarchy, and it’s post-scarcity, so people aren’t facing economic coercion to join Starfleet. Not conforming perfectly to your personal idea of utopia isn’t a blind spot, though Trek has many of those, as well.