(114) Simon Peter said to him, “Let Mary leave us, for women are not worthy of life.”
Jesus said, “I myself shall lead her in order to make her male, so that she too may become a living spirit resembling you males. For every woman who will make herself male will enter the kingdom of heaven.”
– Gospel of Thomas
It’s of course possible to find a theological or metaphorical explanation for this. For instance, female may refer to the human self and male may refer to Spirit, so Jesus is talking about the human self aligning with Spirit or reality.
And it’s also possible that Jesus, as I sometimes do, responded with sarcasm to an obviously narrow minded statement.