This is a strange take, evolution resulted in sex as the means to creating the next set of offspring.

Evolution is a process. It can't assign a purpose to anything, because "purpose" doesn't exist outside the minds of people, similar to "justice" and "hope."

The "purpose" of sex is whatever we choose it to be.