From a Biblical standpoint, yes it teaches that lust = sin.

But a proper study will show it's more than just a thought or action, it goes to the heart, to what lies inside.

Everytime a Pharisee would step up to challenge Christ on something, He would say... "You have heard it said... but I say..."

The you have heard part always was based in the physical right here, and the but I say part always focused instead on the inside, the heart issue, the underlying thing that drove the external action.

I struggle with compulsive MB and there is always fantasy/lust tied to it, but as I've grown and learned, I've begun to see the root of it being on wounds and brokenness inside me that drive me to self-sooth etc. If I instead focus on healing from the things inside, I have confidence that the compulsive addictions I run too would decrease.