Dharmaviruddho bhutesu kamo ‘smi bharatarsabha. Sex is allowed only for the begetting of children, not for enjoyment. One can indulge in sex to beget a good child for the benefit of the family, society and world. Otherwise, sex is against the rules and regulations of religious life. A materialistic person does not believe that everything is managed in nature, and he does not know that if one does something wrong, he is witnessed by different demigods. A person enjoys illicit sex, and due to his blind, lusty desire, he thinks that no one can see him, but this illicit sex is thoroughly observed by the agents of the Supreme Personality of Godhead. Therefore the person is punished in so many ways.
… Those who indulge in it are punished life after life.
[Srimad-Bhagavatam 5.14.9, purport]