With Freeman Dyson:
My optimism about the long-term survival of life comes mainly from imagining what will happen when life escapes from this planet and becomes adapted to living in vacuum. There is then no real barrier to stop life from spreading through the universe. Hopping from one world to another will be about as easy as hopping from one island in the Pacific to another. And then life will diversify to fill the infinite variety of ecological niches in the universe, as it has done already on this planet.
If you want an intellectual principle to give this picture a philosophical name, you can call it “The Principle of Maximum Diversity.” The principle of maximum diversity says that life evolves to make the universe as interesting as possible. A rain-forest contains a huge number of diverse species because specialization is cost-effective, just as Adam Smith observed in human societies. But I am impressed more by the visible examples of diversity in rain-forests and coral-reefs and human cultures than by any abstract philosophical principles.
I agree. This is one of my fundamental religious beliefs.