As sense control is the beginning of pious life, illicit sex is the beginning of sinful life. One should not engage in illicit sex, or sex for any reason except having a child with one’s wife. Marriage is meant for begetting children, and in that sense it is a religious institution. Lord Krsna confirms this in the Bhagavad-gita (7.11): dharmaviruddho bhutesu kamo ‘smi. “I am sex that does not contradict religious principles.”
Srila Prabhupada. Second Chance 13: Ajamila Begins His Degraded Life