Spock jokes about the attempted rape on Janice Rand, as sexism rears its ugly head in the original series.
II also believe that Roddenberry's original concept for Rand was that she would have a fairly close friendship with Spock, which might have made his teasing of Janice slightly less creepy in the Enemy Within.
If Spock and Rand were close personal friends, then Spock could have made the comment he did about the second Kirk having some interesting qualities, and in response receive a "oh really" look from Rand. People will accept biting humor from a close friend, that they never would from anyone else.
Rand obviously took it as a joking tease from a good friend, and maybe one she needed at that point.