Aquinas argued that if the primary purpose of sex is for the procreation of children then the purpose of marriage is to provide the most stable environment for them to be brought up in. He therefore condemned sex outside of marriage, writing in Summa Contra Gentiles that ‘matrimony is natural for man, and promiscuous performance of the sexual act, outside matrimony, is contrary to man’s good. For this reason it must be a sin.’