What? That question doesn't make sense! People don't get married just to have sex although if they did i can't see why it would be illegal. Marriage is only "illegal" if one of the people is already married, the people are of the same sex, it's only being done for visa entry. I think that's it unless you want to rephrase the question...
The minimum age for marriage in Northern Ireland is 16 as in the rest of the UK. Bizarrely, however, the age of consent in Northern Ireland is 17 as opposed to 16 in the rest of the UK. I think I've spotted a possible problem for young newly-weds on their honeymoon...
In the CoE marriage ceremony the priest says that marriage was created for... and lists the reasons; can't remember the words exactly but it's for mutual support, friendship, children, sex, and I think more.