I think both Darwin and the Church can agree on one point, if nothing else: The primary purpose of sex is reproduction.
Well, yes. But humans are about the only creatures that have sex when the female is not fertile. Thus, however that came about, sex must fulfill some other role in humans. One role is to help keep parents together, so as to better provide for and raise the offspring, which are more helpless and take longer to mature than those of most other species. Although many birds mate for life without the extra sex, so there may be still more to it for humans.