Adaptation does not necessarily lead to traits which are optimal for the population. This is because selection is often the strongest at the individual or gene level. The evolution of selfishness can lead to a 'tragedy of the commons', where traits such as aggression or social cheating reduce population size and may lead to extinction. This suggests that species-level selection will result whenever species differ in the incentive to be selfish. We explore this idea in a simple model that combines individual-level selection with ecology in two interacting species. Our model is not influenced by kin or trait-group selection. We find that individual selection in combination with competitive exclusion greatly increases the likelihood that selfish species go extinct. A simple example of this would be a vertebrate species that invests heavily into squabbles over breeding sites, which is then excluded by a species that invests more into direct reproduction. A multispecies simulation shows that these extinctions result in communities containing species that are much less selfish. Our results suggest that species-level selection and community dynamics play an important role in regulating the intensity of conflicts in natural populations.