It is possible that life has a meaning.
But it is not mandatory, not even for conscious beings.
Evolution makes so that those who want to live - for whatever reason, or even without any reason - will live, and those who don't want to live will disappear.