Legalism is reflected in the idea that you just need to do such-and-such in order to be a real Christian, as opposed to the Christian idea that goodness reflects dikaiosune, or inner goodness, which is fashioned by spiritual disciplines and then expresses itself through our behavior. A person who gives everything to the poor without changing his character is none the better in terms of the kingdom, which works through modified character. Again, Jesus was making a point: if you aren't willing to sell all your possessions, you can't enter the kingdom of God, and he was saying this precisely to the person who is attached to his possessions, hence the verse on how difficult it is for the rich to enter the kingdom. At the end of the day we can't forget that according to the most basic exegetical principles Jesus was speaking to a particular person about a concrete action, which reflects a general principle. The action he commanded isn't the general principle. He said "hey, you dude, go sell your stuff," and not "you can only enter the kingdom if you sell your stuff."