The reason that living things die is because they are not designed to live, just to reproduce their genes.
Some would expect that humans, and indeed most other mammals, would live far longer than they actually do. Clearly it would be an advantage for an animal to live indefinitely, reproducing at the same rate after adolescence, and continuing to do so until struck down by accident or disease. This does not happen.
Evolution is effectively a process of design, and in any design, trade-offs are involved. In the long run the successful design is the one which maximizes reproduction - the number of surviving descendants.
A mutation which codes for a greater life of the individual, but inhibits the reproduction will be less successful, and will (over time) be bred out. A gene which increased life expectancy enormously, but decreased net reproduction even slightly would be a disadvantage.
Clearly the trade-off here is a complex one - longer life for the individual may also mean that it can produce more offspring in its life-time, but ultimately it is other factors which are more important.
Evolution is not interested in perfection, just efficiency.