Jesus answered him, "Why do you call me good? No one is good but God alone."
Isn't that an odd thing for Jesus to say? Sure, we know Jesus really is God and so He really is good, but why would He answer the rich young man with a riddle, then go on to answer him plainly ("You know the commandments. Sell what you have and follow Me.")? And even if He would, did He really mean to imply that we can't say anyone who isn't God is good? And if so, what are we to make of 1 Timothy 4:4a, "For everything created by God is good" -- to say nothing of the Gospel passages in which Jesus refers to good people?
In saying which He does not exclude men from goodness, but from a comparison with the goodness of God.
Bede: But by this one God, Who is good, we must not only understand the Father, but also the Son, who says, "I am the good Shepherd;" and also the Holy Ghost, because it is said, "The Father which is in heaven will give the good Spirit to them that ask him." ... The Lord, therefore, does not deny Himself to be good, but implies that He is God; He does not deny that He is good Master, but He declares that no master is good but God.
Theophylact: Therefore the Lord intended by these words to raise the mind of the young man, so that he might know Him to be God. But He also implies another thing by these words, that when you have to converse with a man, you should not flatter him in your conversation, but look back upon God, the root and fount of goodness, and do honour to Him.
I don't have anything dogmatic to say about Jesus' statement. I do think it's worth noting that the story recorded by Matthew is somewhat different:
Now someone approached him and said, "Teacher, what good must I do to gain eternal life?"
He answered him, "Why do you ask me about the good? There is only One who is good."
An NAB note characterizes this as softening Mark's language. I think what is important is that the first thing Jesus does, after the young man runs up to him and asks for His advice, is refer all goodness to God. Remember, this isn't just any man; this is the Rich Young Man of the section headings, who ran up eagerly to learn from Jesus but "went away sad, for he had many possessions."
The story might give the impression that the young man was right with Jesus all the way up until the end -- "Teacher, all of these I have observed from my youth" -- but if you look at it closely, you can see that Jesus lost him with His very first words. If the man truly believed that no one is good but God alone -- if, for that matter, he truly believed that Jesus was good -- then he would have been willing to sell all he had. But his many possessions were, for him, a good unto themselves, and he wasn't prepared to see them in the light of the only One Who is good.
Let me add, he wasn't prepared then and there. Perhaps the next day... who knows? I know that my own words run ahead of my faith all the time, and I hope it's not by presumption that I hope for the grace to catch up to them. As another man who asked for Jesus' help said, "I do believe, help my unbelief!"