The Pharisees believed that they had kept every letter of the law—and prided themselves on what was on the outside. As Christ continues to underscore how important the heart is, He takes aim at sexual sin—and says that it isn’t enough to simply abstain from committing adultery, but that you have to keep it out of your mind as well.
Ye have heard that it was said by them of old time, Thou shalt not commit adultery: But I say unto you, That whosoever looketh on a woman to lust after her hath committed adultery with her already in his heart. – Matthew 5:27-28
This would definitely been a shock to those hearing it, for it was one thing for a person to speak about something done in the open, but a whole other thing to talk about what a person thinks about!
As men, part of our wiring (especially before we are married, but even after) is to desire the companionship and physical intimacy of a woman. Their form is attractive. Their proximity is intoxicating. We desire them like nothing else—as has been proved time and again throughout history.
Jesus was pointing out in this comment that though many have not gone through with adultery—or fornication for that matter—many have thought about it. They have undressed women with their eyes, performed acts on them in their minds, and desired them in their hearts. And He says that this is equivalent to having done it—there’s no difference.
God measures man by a divine standard—He judges the heart. It’s not enough to be good on the outside, and that was never the point. The point was that we have to have a new heart—a heart that wants to please Him and that is clean from sin.