Having wealth isn’t sinful in and of itself. The problem is that wealthy people have a tendency to become attached to their wealth. That is the problem with the rich young man of the Gospel. It wasn’t that he was rich per se, but that he wasn’t willing to give up his temporal wealth for incorruptible spiritual wealth.
With that said, many great saints came from rich families and gave everything up to follow Jesus, Saint Francis of Assisi being a good example.