Although the rich considered that he fulfilled the commandments quoted by Jesus; his inner self asked, “What do I still lack (to get eternal life)?” By our “good deeds” we can not obtain eternal life; only through faith in Jesus.
If we are believers; We must recognize that shedding material to help those in need was not a personal matter to deal with this rich; but is a norm applicable to every believer:
“All the believers were one in heart and mind. No one claimed that any of their possessions was their own, but they shared everything they had. With great power the apostles continued to testify to the resurrection of the Lord Jesus. And God’s grace was so powerfully at work in them all that there were no needy persons among them. For from time to time those who owned land or houses sold them, brought the money from the sales and put it at the apostles’ feet, and it was distributed to anyone who had need.” Acts 4: 32-35