The process of natural selection is central to the theory of evolution. Individuals that are somehow less fit to breed are less likely to have their genetics represented in future populations. However, as with life in general, things are not quite that simple. For example, if individuals didn't die then they could represent their own genetics in the future. Why have children at all? Well, one reason is that habitat is limited and there are usually several different species competing for that habitat. Selection not only works within a species, it works between them. With limited habitat, evolution can become a race between species. This race is why we die. Death, like sex, speeds the rate of evolution.
Habitat is finite; populations only have so much space to exist in. When new habitat becomes available, life will fill it very quickly. New habitat can appear either through changes in the environment or in the way a species can use an environment. There are the obvious environmental changes like variations in climate and corresponding sea levels. There are less obvious changes as well. For example, when a species goes extinct, it changes the environment that other species operate in. If one predator in a given environment goes extinct, then there is an evolutionary niche for other predators to evolve into. New environments can also open up when a species evolves ways to utilise resources it could not before. For example, being able to eat a new food, or survive in a different temperature. A salt-water fish that could live in a lower salinity environment would have river estuaries open up to them. Another way a new environment can open up for a species is when barriers to migration are removed. Sea levels could drop enough to allow an island population access to the mainland, or vice-versa. A species could be transported to a new habitat through various means. Whenever new habitat opens up, in whatever way, a competition between species often results. Existing species may be out-competed by a new invading species, or several new species may vie for niches after existing species go extinct. This competition between species makes evolution a race.
An unoccupied environmental niche is easy for a species to evolve into. Even a slight improvement in an individual's ability to exploit this niche provides an advantage that natural selection can favour. With succeeding generations, further slight improvements would also be selected on. However, once a niche is filled by a species, another species would have to evolve a correspondingly better utilisation of the niche. This is very difficult to do when the intermediary steps provide no benefit to be selected for. Species that evolve into a niche first can maintain a permanent advantage. Thus, species that evolve quicker are more likely to expand into new niches and whole new habitats when they open up. The earth is populated by species that won this evolutionary race.
Selection in evolution is either by the individual or by the group. While it is easy to assume group selection is at work, individual selection dominates evolution. The unit of information in genetic evolution is, after all, the gene. However, just as genes work together and share the same fate in an individual, individuals do exist in species and share the fate of the whole. After all, an individual's genetic fitness is moot if there's no one to mate with. When a species goes extinct, by definition, all its individual members are dead. Thus, species are more likely to survive when individuals do things that benefit the species as a whole. Individual genetic lines that do nothing to benefit the species are more likely to go extinct.
Individuals don't evolve, populations do. Each individual's genetic make-up is fixed at conception and this make-up is what is passed to offspring. If an individual has a mutation after conception, positive or not, it is unlikely to be passed onto the next generation. Thus, the variation side of evolution happens at conception. This basic point, that evolution happens at conception, coupled with a limited habitat and inter-species competition to fill said habitat is the reason most life on earth evolved to die. A simple thought-experiment will show why this is.
If we imagine two simplified habitats, each populated by a different species, then the advantages of death become apparent. Each habitat holds a fixed number of individuals; if a new individual is born, it will die unless there is a vacant spot for it to live in. In one habitat, individuals live until they die of accident; in the other habitat, individuals live for a fixed period of time before dying. With the eternal species, creating offspring is risky as death is more likely during pregnancy. When this happens, both the parent and child die while a new space opens up for another individual's child to live in. Thus, having the time to wait for the opportunity to open up, evolution would favour those individuals that held off having children. Reproduction in this environment would be very slow; this slow reproduction means that mutations, and thus evolution, would have limited opportunities to happen. However, in the habitat where individuals die after a fixed period of time, each individual could have offspring with a reasonable chance of living. There would likely be space as other individuals die. The slight chance of dying during pregnancy would be more than offset by the certainty of dying in the end. Thus, the birthrate in each habitat would evolve to match the death rate. However, in the habitat where individuals die at a fixed term, the birthrate would be much, much higher.
The higher the birthrate, the more variations through mutation will occur for natural selection to act on. The same higher birthrate will also allow those positive variations to spread through the population via sex. These factors, combined, will make evolution happen at a faster rate. Eventually, a mutation will come along that allows an individual great benefit. For example, the ability to live in half the space, thus allowing a doubling of population, and a doubling of the rate of evolution. Eventually, a mutation will come along that allows this species to bridge the gap between habitats resulting in inter-species competition. With one species evolving much faster than the other, the slower one will likely be out-competed and eventually go extinct. Over time, species that live forever will be replaced by species that have evolved a mechanism to die.
From this thought experiment, it is clear that there are advantages at the species level when individuals die after a reasonable period of time. Death allows faster reproduction in a fixed habitat. The higher the reproduction, the higher the chance of positive mutations for natural selection to favour. The more selectable mutations that happen within a given period of time, the faster a species will evolve. The faster a species evolves, the better it will be able to compete against other species for habitat. Species that are less able to compete for habitat are more likely to go extinct. Individual genetic lines in an extinct species are dead. Thus, limited habitat and inter-species competition work together to provide an evolutionary advantage where death will evolve over time.
Death evolved because it allows us to have children. These children benefit our species by helping it adapt to new environmental niches. Our species, and thus our genetic line, continues because of this adaptability. In the great evolutionary race, adaptable children beat eternal life. We are what we are because we die.