The Prophet (peace and blessings of Allah be upon him) said:
"There are only 4 kinds of people in this world. (The first is) a slave whom Allah has blessed with wealth and knowledge, and he fears Allah with regard to them, and uses them to uphold family ties, and acknowledges the rights that Allah has over them. He has the highest status.
(The second is) a slave to whom Allah has given knowledge, but not wealth. His intention is sincere, and he says, 'If only I had wealth, I would do (good deeds) like so-and-so (the first slave).' He will be rewarded according to his intention, so their reward will be equal.
(The third is) a slave to whom Allah has given wealth, but not knowledge. He spends his money aimlessly, neither fearing Allah with regard to it nor using it to uphold family ties nor acknowledging the rights that Allah has over it. He has the lowest status.
(The fourth is) a slave to whom Allah has given neither wealth nor money. He says, 'If only I had wealth, I would do (bad deeds) like so-and-so (the third slave). He will be punished according to his intention, so their burden of sin will be equal."
(Reported by Ahmad and al-Tirmidhi,
and classed as saheeh in Al-Targheeb wa'l-Tarheeb, 1/9