The Pharisees thought they had Jesus trapped, asking Him whether a man could divorce his wife for any reason, but He reminded them that in the beginning God created one man and one woman for life.
“Why then did Moses command to give a certificate of divorce, and to put her away?” (Matthew 19:7).
Did Jesus contradict Moses? No, for Jesus explained why Moses allowed, but did not command, divorce in the rest of the text.
Jesus showed that we must strive for God’s ideal, although He may allow somethings to take place. We often look for what we think are loopholes that will allow us to get away with something, but the Lord knows our hearts and He shall judge us accordingly.