What is the purpose of a species?
The purposes of a species is survival. There exists ways in which evolution can decrease the chance of species' survival. For instance, natural selection occurs at different levels, hence the survival of a gene does not automatelly lead to survival of individuals that are carying that gene. Hence, if a gene accidentally modified, usually called Trojan gence, spread into population, it could lead to extinction of that population, whose individuals are carying the Trojan gene.
Another cause that could lead to population extinction is represented by detrimental mutations, whose accumulation pace is faster than the pace of natural selection, the only process that can eliminate detrimental mutations.
Sexual selection can also represent a cause of extinction because it can favour characteristics that can decrease species' robustness and adaptation to environment.