As far as I know, the priority for evolution is survival till reproduction, so lifespan is low priority. Short lifespans = more generations which allows more opportunities to test mutations. Long lifespan = less generations which allows a successful mutation to propagate longer. Some traits are more efficient than others within a niche depending on competition.
But does this explain why certain species get their lifespan? Why does an adult mayfly live 1-3 days while a creosote bush lasts 11,700 years? (
source)