I know of Nietzsche's criticism of afterlife-thinking.
I think Nietzsche himself may be guilty of this thinking -- not in terms of a Heavenly afterlife, but with desiring influence of his writings after death. I assume he suffered more than he needed to in order to achieve this. For example, he could have spent more time enjoying the company of others, or just chilling, rather than struggling with book writing through ill health. He could have managed better or possibly delayed his mental decline.
It seem that like Socrates he sacrified his life for something else he thought valuable. He was not active with lecturing, like say Emerson, so his hope was for influence after he died through his books. I believe he said - something along the lines - that he hoped his books would be his 'children'. To me, this does seem other-worldly; sacrificing this life and the things of the earth (friends, love, family, real children, pleasure, etc.) for an ideal where he wouldn't exist.
Many would say the legacy was worth it. But it seems to undermine his criticism of other-worldliness through his own example, as well as other major aspects of his philosophy.
But coming back to the question: unless you are making a difference in your own lifetime (when you have skin in the game), making an impact actively, should you be considered other-worldy, and perhaps selfish, vain and otherwise misguided? What if Nietzsche never achieved a fame greater than his lifetime, would his personal sacrifices be a waste? How many writers, philosophers and artists have died in obscurity after similar legacy-seeking? Of course, we don't know (survivorship bias), but let's assume at least one other.
Nietzsche is a popular philosopher. I would say there are cults of personality. Fandom is fine, but I hear/read people uncritically proclaiming the Superman way of life following Nietzsche's Zarathustra and other writings. Anyone who takes this seriously could well be wasting their lives chasing legacy, living with unnecessary anxiety and frustration, neglecting friends, family, partner, rather than enjoying and contributing to all life has to offer. It's unlikely that such people will have the same after-death influence as Nietzsche did, so we couldn't even look back and argue whether their sacrifice was worth it.