Matt 5:28 says that even the tempting thought we entertain is sin.Temptation is not the same as sin. As you pointed out, even Jesus was tempted. But He didn't sin.
If I want to tell a lie, but never do, I am not a liar. If I want to steal something, but never do, I am not a thief. If I want to sleep with a married woman, but never do, I am not an adulterer.
Having the urge to do something is not sin. Giving in to that urge is what makes it sin.
Jas 1:13; Let no one say when he is tempted, "I am being tempted by God"; for God cannot be tempted by evil, and He Himself does not tempt anyone.
Jas 1:14; But each one is tempted when he is carried away and enticed by his own lust.
Jas 1:15; Then when lust has conceived, it gives birth to sin; and when sin is accomplished, it brings forth death.
Lust is simply what we want. I want cookies, I don't want spinach. I could be tempted by cookies, but I could never be tempted by spinach, it has no appeal to me.
I can honestly say, homosexuality has never had any appeal to me. Not once ever. However fornication and adultery on the other hand, there have been times I was tempted.
But I have never touched another woman since I have been married to my wife.
Temptation gives way to lust, lust gives way to sin, sin leads to death.
But I do agree with you that there is a difference between thoughts and actions. Matt 5:32 and Matt 19:9 make it clear that only the action of adultery can be used as grounds for divorce.