Mark 10:1-12 for context.
Jesus then left that place and went into the region of Judea and across the Jordan. Again crowds of people came to him, and as was his custom, he taught them.
2 Some Pharisees came and tested him by asking, "Is it lawful for a man to divorce his wife?"
3 "What did Moses command you?" he replied.
4 They said, "Moses permitted a man to write a certificate of divorce and send her away."
5 "It was because your hearts were hard that Moses wrote you this law," Jesus replied. 6 "But at the beginning of creation God made them male and female.'[a] 7 For this reason a man will leave his father and mother and be united to his wife,[b] 8 and the two will become one flesh.'[c] So they are no longer two, but one flesh. 9 Therefore what God has joined together, let no one separate."
10 When they were in the house again, the disciples asked Jesus about this. 11 He answered, "Anyone who divorces his wife and marries another woman commits adultery against her. 12 And if she divorces her husband and marries another man, she commits adultery."
That passage is about divorce not gay marriage. Given full context it could be argued that the gender pronouns used are used in the general sense and not specific to "a man" this is reinforced as the correct reading by the final passage which provides disambiguation by clarifying that a woman who divorces her husband is just as guilty.
Makes you wonder how many divorces have used the passage that condemns their actions to condemn others.