3 Nephi 12: 27-29:
"Behold, it is written by them of old time, that thou shalt not commit adultery; But I say unto you, that whosoever looketh on a woman, to lust after her, hath committed adultery already in his heart. Behold, I give unto you a commandment, that ye suffer none of these things to enter into your heart;"
Here it is again - the heart. It is the intent and not just the act. It is not enough that you stop short of doing the thing commanded in the Law of Moses. Christ is attacking the root cause, the internal trouble which causes the mistakes.
The Law of Moses is not being replaced with a new era of easy grace triggered by confession for salvation. The Head of the new Dispensation, Christ, is instead providing a much higher standard for mankind to adopt in place of carnal commandments.
You must raise your thoughts to a higher level. Sexual appetites and passions must be kept within the bounds the Lord has prescribed. For this new, higher standard, it is not enough to just refrain from immoral acts, but you must purge thoughts. Neither lust of a woman, nor any of "these things" should "enter into your heart." This uniform standard applies to all: male and female, married or single, without regard to who or what causes your lusts. It is universal.
The raging controversy going on at present over President Packer's last General Conference address entirely misses the point. Whether your sexual attraction is male or female, it is to be confined in thought and deed to the bounds prescribed by the Lord, and the Lord has rather clearly identified the bounds in this sermon.
The heart is where sin begins. So it is the heart which Christ would have us cleanse. All else will follow.
No one knows how formidable an obstacle this is until they have confronted it themselves. Nor can a person who confronts this challenge succeed at the first attempt. C.S. Lewis made such a profound observation on this subject it is worth quoting here:
"No man knows how bad he is till he has tried very hard to be good. A silly idea is current that good people do not know what temptation means. This is an obvious lie. Only those who try to resist temptation know how strong it is. After all, you find out the strength of the German army by fighting against it, not by giving in. You find out the strength of a wind by trying to walk against it, not by lying down. A man who gives in to temptation after five minutes simply does not know what it would have been like an hour later. That is why bad people, in one sense, know very little about badness. They have lived a sheltered life by always giving in. We never find out the strength of the evil impulse inside us until we try to fight it: and Christ, because he was the only man who never yielded to temptation, is also the only man who knows to the full what temptation means--the only complete realist." (CS Lewis, Mere Christianity, Chapter 11.)
Those who would rather settle into a comfortable enjoyment of their sins find discomfort in being reminded they are wrong. So when President Packer reminds them of this, it is painful, and they want him to retract his words. It would be better to consider them, for whether he retracts them or not, it will not change the underlying problem of sin. Only by confronting and overcoming sins within us will we ever become people who will be preserved in the coming harvest.
Imagine, if you can, the idea of impurity being a compound which exists within you. A compound that could be identified by the Lord and burned away. Think of it like the fuller's soap or the refiner's fire, where impurity is removed and something pure and clean is left behind. (Mal. 3: 2-3.) To survive that burning purge there must be so little to burn away that the injury from the burn will not threaten life. It is a useful way to examine what is inside you. And a useful way to reconsider your thoughts.
This leads to the final question: What is the difference between the mind and the "heart?" This commandment addresses the "heart" in you. What is the "heart?"