How we interpret this will depend to a great deal on our political and theological stances.
Liberals can interpret this as a criticism of wealth and of capitalism. This is the straightforward reading of this passage (and similar ones in Markand Luke). If it truly is impossible for a rich man to enter the kingdom of heaven, then surely wealth is not something to which we should aspire.
More conservative people can interpret this as a warning against excessive love of money and possessions, but not against all wealth. In this view, the real issue is not that a person has money and wealth. Instead, it is that they value this wealth above things like religion and God.
In order to understand the story truly, you have to realize that there is a context. The immediate context is another story of how Jesus allowed children to come to him (Matthew 19:13-15). In these verses Jesus does something unusual within the historical context and says something profound.
He allows little children to come to him. In the ancient world, children were not looked upon too highly. Jesus challenges this notion. He allows them to come to him and places his hands on them. Jesus also says that the kingdom of God belongs to them. This really is an amazing statement, especially in light of the story that follows.
By placing this story right before the story of the rich young ruler, the author is inviting the reader to compare and contrast. The rich young ruler wants to inherit eternal life (the kingdom of God) and he does not get it. He trust in money and morality instead. To put it another way, wealth and his perceived good works are his god. There is a sense of pride.
With children things are different. Children know that they are incapable. They come bankrupt. They come with faith, which the gospel writers all point to as the path to eternal life.