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).