All living beings are programmed with the urge to survive. Our fear of death is what stops us jumping off cliffs and walking into volcanoes -at any rate, from doyng so without elaborate protection arrangements.
That urge is so deeply-rooted in us that it triggers the imagination - the one faculty which makes us unique among animals -into forming ideas of survival after physical death. Because we - again uniquely -are able to understand that death is inevitable, and to know when we ourselves are dying.
So whether an afterlife exists or not (and I hope not, one go around has been quite enough for me, thank you), there is still the urge to hope, if not believe, that we will survive.