Mark 10:18 has been used by some Christians and commentators to show just the opposite, namely, that Jesus was alluding to himself as God, i.e., his deity. In other words, the rich young ruler calls him “Good teacher.” When Jesus says that only God is good, he is thus trying to hint at his own deity (since the man called him “good”) which the young man failed to see.
The point of Jesus’ reply, however, is not to draw attention to His deity, but to help the rich young ruler understand that in absoluteness, only God is good and that he can have much more with the Lord than legal obedience. He can have a relationship, “treasures in heaven” as it were (vv. 21).
This, however, can only come by the complete and full renunciation of one’s claim to piety, followed by a turning over of one’s life to God (cf. Phil 3:7-11). But, some people really want moral piety and money, not a relationship with the Lord (vv. 22-23). Thus, the rich young ruler was indeed guilty of covetousness, a violation of the last commandment (Ex 20:17; Mark refers to it as “defraud”; the overtones with money are apparent). The commandment “you shall not covet” is a commandment (like all of them) which stands in close relationship to the first commandment (i.e., You shall have no other gods before me). What Jesus tried to do with him was, rather than point out that he was coveting, he attempted to offer him something more attractive than that which he coveted; God instead of money. It is highly unlikely with the early church’s commitment to the sinlessness of Christ that this statement is implying as much (John 8:46; 2 Cor 5:21; Heb 7:26).