As Christians, we ought to live apart from the wickedness of the world and in the Spirit of God. We can’t walk in sin and also walk with God.
Our bodies are the temple of the Holy Spirit and it is not our own. Each time you defile it with pornography and then masturbation, you are driving out the Spirit of God.
The Bible teaches, “thou shalt not commit adultery”. However, It is more than having sex with someone that is married, that is not our spouse.