Let's remember that it’s not unusual for even the mildly mentally ill to indulge in fantasy scenarios because they cannot accept any fault of their own. The more severe the mental illness, the more elaborate and "real" the fantasy can become. It can be extremely dangerous to confront such a person with the reality of the given situation because it could do far more harm than good, and besides, they'll never believe you anyway.
Lester could not accept that it was her own mental issues that prevented her from starship command, so in her unstable mind, the reason became because "women aren't allowed to command starships" (regardless of whether or not there actually were any female captains at the time) this was her way of dealing with something she could not otherwise confront, i.e. her own unsuitability for such a position.
The sad thing is, Lester’s "defense mechanism" in this case, only deepened her neurosis apparently, as it seems to have fostered in her “an intense hatred of her own womanhood”.
At any rate, Kirk did the right thing by going along with her fantasy scenario, and not challenging it, possibly on the advice of a psychologist (Dr. McCoy?) or simply because of past personal experience with her on this subject, but in the end, it didn't matter anyway.