Instead of simply limiting or licensing certain actions, Jesus looked deeper into the attitudes behind such actions. Legalism can be used to limit people where they should be free, and it can also be used to license people when they should be bound.
The Pharisees thought people had the right to divorce as long as it included a written settlement (Deuteronomy 24:1-4). It was not that the action was always wrong, but that the attitude often was. If there is not a breaking of the vow by the other partner, like committing adultery, then you commit adultery by breaking the vow yourself.
In these matters, we can be overly permissive or overly prohibitive. There is the legalism of license and a legalism of limitation. Why would we want to get a divorce? Marital infidelity gives us cause for concern but even then it doesn’t require divorce, it only permits it. Jesus (Matthew 19:3-12 / Mark 10:2-12) and the Apostle Paul (1 Corinthians 7) speak of other qualifications. The point is about the heart.
Jesus gets to the heart of the spiritual matter. If your heart has ambition for another then you are not aiming God’s way. Your evil heart will find some way to justify your actions, without regard to the other person.
Jesus wasn’t lacking in compassion for sinful people, He was stacking the deck against the self-righteous. The person who is faithful in their heart is to be protected against the person who is frivolous. If you think that this doesn’t apply to you, that you meet the standard, because you have always had a faithful marriage, or because you have never divorced, remember what Jesus had just said about looking and lusting in your heart. You may have not done the action, but you have had the attitude. In our hearts we are all guilty. Our thoughts, words, and deeds won’t garner the favor of God (Isaiah 64:6).
Your self-esteem must be slaughtered if you are to dive deeper than the Pharisees.