I don't think the episode was sexist and I don't think Kirk's comment at the end of the show was meant in a sexist way. Kirk wasn't the one making Starfleet policy so he wasn't implying from a personal standpoint that women couldn't be effective starship captains.
Janice Lester was batshit insane. Instead of being a Starfleet officer and working toward establishing the acceptance of women in command positions, she was consumed with jealousy and succeeded only in ruining her own life.
I think it's important to understand something about the time TOS was made; women were only allowed to enlist or become officers in certain areas of the military, mostly medical probably. It wasn't until the 1970's that women could enter most areas save for combat training or duty. So at that time it wasn't farfetched for the show to portray women as not having all the opportunities the men had. The show was constrained somewhat by what the culture was like at the time it was made.