The purpose of sex

Reproduction with useful hindrances

NTR

Sex is necessary for reproduction. But some species can reproduce asexually. So what is then the purpose of having sex?