The point of that passage is, if you're married and have sexual thoughts of someone who is not your spouse, you're cheating on them.
But if we walk in the light, as He is in the light, we have fellowship with one another, and the blood of Jesus, His Son, purifies us from all sin.