Jesus is speaking plainly about the sinful human heart, to counteract his opponents’ self-righteousness. We aren’t made bad by our environment but by what’s wrong inside all of us. Thoughts rise up from within, often occupying our minds, which are unfit for God, unloving towards others. Jesus gives examples, starting with sexual immorality. Israel’s laws on this (Leviticus 18) said that God’s design of the faithful marriage of a man and woman should be honoured as the place for intimacy. But the laws warned not only of actions against this but of the attitude which spoils it. Immorality begins in our sinful hearts. Which is why Jesus calls for repentance – a new start which he can give, where sin is forgiven.
And here is a short talk based on the same passage: He Changed The World (Episode 25)