Jesus looked at him and loved him. “One thing you lack,” he said. “Go, sell everything you have and give to the poor, and you will have treasure in heaven. Then come, follow me.”
This particular man had everything: money, power, fame, youth, and a morally upright lifestyle. And yet we still see him running to Jesus and falling on his knees with a question burning in his heart. "What must I do to inherit eternal life?" It was an obvious question with an obvious answer: obey the commandments, but all these things this man has done and still he feels empty. "There must be more to life than this?"
And then, Jesus tells him what he wanted to hear, that indeed he has overlooked something, and that there was but one thing he lacked: A personal relationship with Jesus Christ. The command he gives here is to be taken together. Charity and altruism is not enough: he must follow Jesus, yet still he must give all that he has to truly follow.
All his life he kept the law and was left unfulfilled, and yet when the time came and the personal invite from Jesus Christ into a real relationship with the Divine Trinity was offered, the one and only thing which can fill that spiritual void, the man walked away back to his wealth which has left him so empty before, back to his life of longing for more. In the end, even the man who has everything but has not Christ is left wanting more.