There are whole books written on this subject which deal with the complexity
of how a process like ageing or senescence could be selected into a population:
see for example, Longevity, Senescence and the Genome by Caleb Finch.
Just one thing though, all this talk about organisms (or populations of)
"selecting" for senesence can't have happened directly. Since the selection
(death) is postreproductive. So that even if a single organism's death has
a direct benefit to the rest of the population, there has been no selection.
This organisms hasn't passed on genes to any more offspring than any other
single organism within the population. Thus "death" does not get selected in.
There are lots of other possibilities. Two very obvious ones: first, that
the genes which later cause senescence and death are of benefit to young
(prereproductive) organisms or second, that senescence and death are
inevitable from systems with faulty repair mechanisms. These mechanisms
seem to vary for differen't species. The book by Finch extensively
reviews the possible mechanisms and the species in which they are thought
to occur.
Jennifer