The thing to remember is that Janice Lester was psychotic. It's easy enough to interpret her belief that women weren't allowed in command as a paranoid delusion, a rationalization for her own inability to measure up. Of course that's not how Roddenberry apparently intended it; it's pretty clear that he intended the episode to say "It's crazy for women to aspire to do men's jobs and they should be happy in their own separate societal roles that are valuable in their own way."
Yet Rodenberry introduced a female First Officer in the original pilot. And that was apparently shot down by the studio for the 2nd pilot.
But I agree it seems that the intention of the script was to say that females aren't suited for such jobs especially Kirk's last line and Spock not disagreeing. I think we all wish at that point Spock had piped up listing names of females Starship Captains past and present.
I know GR was credited with the story but did he actually write the dialog.