This statement comes from Luke 18:18-22, “And a certain ruler questioned Him, saying, ‘Good Teacher, what shall I do to inherit eternal life?’ And Jesus said to him, ‘Why do you call Me good? No one is good except God alone. You know the commandments, “DO NOT COMMIT ADULTERY, DO NOT MURDER, DO NOT STEAL, DO NOT BEAR FALSE WITNESS, HONOR YOUR FATHER AND MOTHER.” ’And he said, ‘All these things I have kept from my youth.’ And when Jesus heard this, He said to him, ‘One thing you still lack; sell all that you possess, and distribute it to the poor, and you shall have treasure in heaven; and come, follow Me.’ But when he had heard these things, he became very sad; for he was extremely rich.”
After Jesus spoke to the ruler, that rich ruler became very sad. Jesus saw the man’s heart, and knew that his first love was for his wealth. Jesus proceeded to mention all the commandments which referred to treatment of other people. The ruler responded he was keeping those laws. However, that man was not keeping the “first and great commandment,” which is to “love the Lord your God with all your heart, and with all your soul, and with all your mind.” (Matthew 22:37,38) Jesus revealed to the ruler what was lacking in his heart – the most important part – to love God above all else.
The lesson for each of us is to look at our lives and see if there is anything more important to us than God. We are to love Him supremely, and secondarily to love all mankind, even our enemies. If there is anything more important to us than God, we are advised to “sell all that we possess” – to get that out of our lives so that it will not keep us from our main goal, to serve and praise God.
We also notice the question in Luke 18:18 was, “what shall I do to inherit eternal life?” Jesus’ answer to his question is addressed to those who are looking to inherit eternal life. While all mankind will have an opportunity in God's Kingdom to receive eternal life on earth, those who are following Jesus in this life to be a part of the “Little Flock” (Luke 12:32) who inherit the kingdom (who will reign over the rest of the world in that Kingdom – Revelation 20:6) – these are the ones here being addressed by Jesus, and are the only ones promised “treasure in heaven.”