And wealth.
Socialism - I tell you the truth, it is hard for a rich man to enter the kingdom of heaven. Again I tell you, it is easier for a camel to go through the eye of a needle than for a rich man to enter the kingdom of God. Matthew 19:23-24
He wasn't against wealth, my friend.
That passage you quoted had to with the young ruler as stated in Matthew 19:16-22 who came to Jesus seeking advice on how to be eternally save. The problem with the young prince, which is the problem of many people today, is that they love their wealth and properties more than God. They have more faith and confidence on what they have than in God.
Jesus was against the Love of Money, not Money: 1 Timothy 6:10
In God's eyes, loving anything more than him is idolatry.
Nicodemus, Matthew, Luke, Zacchaeus, and Joseph of Arimathea were people who were well off or rich and they believed in Jesus and Jesus did not condemn them for their wealth.