It comes in the narration:
Narrated Abu Huraira:
Some poor people came to the Prophet (ﷺ) and said, “The wealthy people will get higher grades and will have permanent enjoyment and they pray like us and fast as we do. They have more money by which they perform the Hajj, and `Umra; fight and struggle in Allah’s Cause and give in charity.” The Prophet said, “Shall I not tell you a thing upon which if you acted you would catch up with those who have surpassed you? Nobody would overtake you and you would be better than the people amongst whom you live except those who would do the same. Say “Subhana l-lah”, “Al hamdu li l-lah” and “Allahu Akbar” thirty three times each after every (compulsory) prayer.” We differed and some of us said that we should say, “Subhan-al-lah” thirty three times and “Al hamdu li l-lah” thirty three times and “Allahu Akbar” thirty four times. I went to the Prophet (ﷺ) who said, “Say, “Subhan-al-lah” and “Al hamdu li l-lah” and “Allahu Akbar” all together [??], thirty three times.”
Imam As Si’adi said:
In this (narration) is proof that if the possessor of wealth brings out (from it) its rights and acts in regards to it with that which he is commanded with, then it is a means of attaining higher levels and permanent enjoyment!
Look at what occurred to Uthman, Abdurrahman Ibn Awf رضي الله عنهما and similar to them due to wealth.
If he doesn’t fulfill its rights, then it is a provision for him to the hellfire, and refuge is seeked with Allah from that.
Thus wealth is not praised nor dispraised unrestrictedly.
[Sharh Umdatul Ahkaam 172]
Majid Jawed Al-Afghanee