"There is nothing better for mortals than to eat and drink, and find enjoyment in their toil. This also, I saw, is from the hand of God; for apart from him who can eat or who can have enjoyment? For to the one who pleases him God gives wisdom and knowledge and joy; but to the sinner he gives the work of gathering and heaping, only to give to one who pleases God. This also is vanity and a chasing after wind" (Ecclesiastes 2:24-26).
This chapter seems to suggest that everything but eating and drinking and enjoying our own toil (which seems to imply that we not leave an inheritance) is meaningless.
It is generally thought that Ecclesiastes was written somewhere between 450 and 330 B.C.E.—a time after the return from Babylon when the nation of Israel was prospering, but individual lives were not. There's a sense of helplessness that must simply be accepted as "how life is." This is an inevitable step on our path to a higher dimension of consciousness; it helps us not to take things so personally, to recognize that we're part of a much larger flow of life. And it prepares us for the next step, which is to realize that we are to create the "new things" we wish to experience.
Having just responded to a question about 2 Corinthians, I'm struck by the similarities between the two. In both cases the author is saying that everything in the human experience is transitory. (Paul says the only exception is the Power of Love; I'm not sure the author of Ecclesiastes would agree.) The best we can do is live with the limited consciousness of spiritual children and enjoy the life for what it is. We will come to understand fully—to see God "face to face." But it won't be because we have earned divine favor. It won't be because of what we've done, but of who we are: complete and infinite expressions of eternal Spirit. Given that Truth, we are to fully enjoy our mortal experiences as we move toward our spiritual realization.
As for inheritance, I think it's entirely up to us. It is neither right or wrong; it simply is. The only question is whether we are making the choice out of mortal fears or out of love.