For some people, the primary purpose of sex is reproduction. For most people, however, the primary purpose of sex is social bonding, pleasure, etc.—in other words, non-reproductive purposes. If you want to look at human sex as a whole on this planet, 99.999% of the sex we're having is for non-reproductive purposes, so that's why I confidently said the primary purpose of sex is not reproduction. You need only look at infertile couples, elderly couples, gay couples, etc. to see that the primary purpose of sex is not reproduction. The fact that I wouldn't be here if it weren't for sex that resulted in reproduction is irrelevant to sex's primary purpose.
Honestly, the conversation about the purpose of sex can and should end here, since a thing only has as much purpose as we subjectively give it. However, if you want to talk about the evolution of sex in humans, it should be noted that the evolution of sex in humans happened in conjunction with our evolution to become social animals. Sex is an important part of that social bonding. It's pleasurable, it causes the brain to do all sorts of things related to social bonding, and human women specifically evolved the ability to have sex even when they're infertile or already pregnant. A person who says the primary purpose of sex is reproduction probably isn't doing it right.