Note what socialism is. A system where the state or collective community dictates the distribution of goods.
What is Jesus said is for the man to change his heart in a completely voluntary action of love towards others. The man chose not to and Jesus let him walk away.