There is an apocryphal gospel called "The Gospel According to the Hebrews" most of which is lost; in one of the fragments which remain there is an account of this incident which sheds a little light on its meaning. Here is how that ancient text records this story:
The rich man said to Jesus, "Master, what good thing must I do really to live?" Jesus said to him, "Man, obey the law and the prophets." He said, "I have done so." Jesus said to him, "Go, sell all that you possess, …
Luke, Philadelphia: Westminster Press, 1975, p. 228., by William Barclay