It's not what you do, but how you live. The young man wanted to buy his way into Heaven by doing something "good", but Jesus knew he was a prisoner to his possessions. Jesus isn't saying that the rich can't get into Heaven. St. Paul often thanked the people who bankrolled his ministry. These people
happily parted with their wealth/possessions in order to further the Kingdom. The same is true today. Ministry costs money and the Church needs generous benefactors to help pay for the Mission.
Jesus' challenge to the young man is about his priorities. Anything you put before Christ will keep you out of Heaven. Obviously, this young man loved his possessions more than he loved God. Do I put anything before God? Spouse, friends, kids, possessions, prestige, etc? Anytime anything comes before God, I am blocking my way to Heaven. And, I'm going to push the idea a little further...
Say I've got God at the top of your list, but I've not aligned my priorities properly, then, I've got a problem. For instance, I'm married and have a child, therefore my husband and son come first (after I take care of my basic needs: mental, physical, and emotional health). But, let's say that I put serving at church ahead of taking care of my son and husband - like all my waking hours are spent at church. And, I mean all my waking hours, not just a short term crazy period to help with a fundraiser or dinner dance. When I neglect my first vocation of wife and mother, then I am blocking my way to Heaven.
It's not what you do or what you give, but how you live and order your life.