Evolution does optimize longevity in at least one way.
Chromosomes have a limited number of telomeres, each time the cell divides the telomeres become shorter. If your cell runs out of telomeres it can't divide anymore. This is one of the primary mechanisms the body balances repair against cancer risk. Current max of human life is about 120. If you don't "solve" the telomere problem you are not going to extend life past 120, though you may have more people live that long and may improve quality of life in later years.
Our species has a good balance that lets us live well past reproduction age, presumably because there is evolutionary pressure (benefit) to having elderly people around to pass on knowledge, help raise grandchildren, etc.
You can do things that extend the telomeres, but that makes cells more likely to reproduce out of control (cancer). This is a very hard "problem" to solve because cell final death is so important in preventing cancer. We are not even close to solving this, it would require revolutionary biological understanding.