Evolution by natural selection favors traits that enhance an organism's chances of surviving and reproducing. So you'd think evolution would lead to organisms that could stay strong, healthy, and fertile forever.
Obviously, though, that's not the case. Almost all species of animal, including humans, have a limited lifespan and lose their fitness and fertility as they age. Why?
There are a couple of theories. The main one, which is still the most accepted, was first articulated in the 1950s by a scarily intense-looking British MD named Peter Medawar (below). Dude, you're freaking me out with that cold stare!
Anyway, Medawar's theory has to do with the fact that nature is harsh, and most wild animals die from things like predators, accidents, or disease well before they reach their maximum lifespan. That means that old individuals are rare in animal populations, even when age itself is not what's killing them. You can see that illustrated in the graph below, which I made for a hypothetical animal species in which individuals have a 50% chance of getting killed in any given year. Remember that this demographic pattern arises even without aging. I haven't said anything yet about why aging occurs, but I'm getting to it.
Since the chances of surviving a long time in a dangerous environment are slim, there's strong evolutionary pressure for animals to kick ass and reproduce when they're young, whereas there's little pressure for them to maintain their health and fertility beyond the age when they're likely to be dead anyway. It's easy for genetic mutations that cause deterioration with age to accumulate in a population where most of the individuals breed and die before they're old enough for the deterioration to start. For example, natural selection would quickly get rid of a mutant gene that caused arthritis early in life, because those that had the gene would be less likely to reproduce. But natural selection wouldn't easily get rid of a gene that caused arthritis late in life, because most individuals with the gene would have already reproduced and died before the arthritis could interfere. Genes that cause age-related ailments may spread even easier if they have beneficial effects when the organisms that have them are young. E.g., evolution would favor a gene that increased early reproduction, even if the same gene lead to sterility in older individuals.
One of the predictions of Medawar's theory is that species that lead dangerous lives in nature will also tend to age early, while species that have few predators or risks will have evolved to stay healthy and fertile longer. That's why mice, which are very vulnerable to predation in the wild, only live a couple years in captivity, while the Aldabra Giant Tortoise, which has no natural enemies, may have an unlimited lifespan.
And what a life it is!
Humans are a funny case because modern civilization has drastically reduced our chances of getting killed by predators, diseases and accidents, but evolution hasn't had enough time to push back our aging process accordingly. Given enough generations of modernity, we could potentially evolve to stay healthy and fertile longer, but there are a lot of other things going on with human population and society that make our future evolution hard to predict.