Hi @Suren_Petrosian. Good question. I think Jesus is doing a couple of things when He asks, “Why do you call me good?”
First, this is another way of putting the question that Jesus asked elsewhere, “Who do you say that I am?” as though Jesus is saying, "God alone is good and if you call me good, are you ready to confess me as God?’’ We see the young man’s answer in verse 20, where he addresses Jesus only as “Teacher.” He drops the word “good”. As with so many, he is willing to accept Jesus as a teacher, but nothing more.
I think you touched on the second thing Jesus is doing here, that He is getting the young ruler to examine his own goodness. Remember that Moses said The Law establishes our righteousness if we keep it (Deuteronomy 6:25). Notice how Jesus answers the young man by pointing him back to The Law, which he claims “all these things I have kept from my youth.” So, professing his own righteousness in The Law, he acknowledges that even his best has not earned him eternal life.
In this exchange, Jesus holds to His teaching in the Sermon on the Mount, “unless your righteousness exceeds the righteousness of the scribes and Pharisees, you will by no means enter the kingdom of heaven” (Matthew 5:20). The young man claimed he was as blameless in The Law as the Pharisees and Jesus, by His answer, said, “Not good enough!”
All of this leads us to the gospel that Paul preached, “the righteousness of God apart from the law is revealed…the righteousness of God, through faith in Jesus Christ, to all and on all who believe” (Romans 3:21-22). You can see why Paul, who had the same boast as the rich young ruler, cast it aside “that I may gain Christ and be found in Him, not having my own righteousness, which is from the law, but that which is through faith in Christ, the righteousness which is from God by faith” (Philippians 3:8-9)
Praying this helps.