It's a two-step manoeuvre: one, morality is "immanentised", meaning, it's made into an essential and necessary part of reality, and two, immortality is taken as the moral Good. You can also refine this by justifying immortality as the Good on utilitarian grounds (for example, so that euthanasia isn't ruled out a priori).
Immortality isn’t achievable. It’s a statistical certainty something will kill you eventually. And on the extremely rare chance that anyone lives long enough, the heat death of the universe will ensure it. As such, basing morality on immortality is foolishness.