"'But at the beginning of creation God made them male and female. "For this reason a man will leave his father and mother and be united to his wife, and the two will become one flesh." So they are no longer two, but one flesh. Therefore what God has joined together, let no one separate.'" NIV translation
Jesus schooled the Pharisees on the topic of marriage by quoting and explaining Genesis 2:24. In the Jewish mindset, two becoming one flesh is an intimate relationship so close that the other person's desires are more important than your own. This is also what John described in his first letter. Jesus reminds them that a real marriage is one in which God has brought the couple together. If God has done that, then He has given them the ability to put the other first. If that is the case, then nobody will be able to tear them apart. It is interesting to note that Jesus is not talking about a piece of paper from a government binding two people together like a contract. He is talking about the hand of God at work in the hearts of a man and a woman.
"When they were in the house again, the disciples asked Jesus about this. He answered, 'Anyone who divorces his wife and marries another woman commits adultery against her. And if she divorces her husband and marries another man, she commits adultery.'" NIV translation
In Jewish practice, it was the man who could give his wife a certificate of divorce and send her away. Jesus explained that, if this was the wife that God had sent him and he put her away, it would be adultery to be with any other woman. Jesus went on to extend it to the woman as well knowing that there would be a time when either one could send the other away.
Under Jewish law, adultery was all about the physical relationship between a man and a woman. Jesus extended it to the heart and simply looking on a woman with lust in what is known as the sermon on the mount (see Matt. 5:28). The heart is the center of the soul and so Jesus was, in fact, extending adultery into the spiritual realm.