Abu Huraira reported Allah's Apostle (ﷺ) as saying:
A man expressed his intention to give charity, so he came out with charity and placed it in the hand of an adulteress. In the morning, the people were talking and saying: charity was given to an adulteress last night. He (the giver of Sadaqa) said: 0 Allah, to Thee be the praise-to an adulteress. He then again expressed his intention to give charity; so he went out with the charity and placed it in the hand of a rich person. In the morning the people were talking and saying: Charity was given to a rich person. He (the giver of charity) said: 0 Allah, to Thee be the praise-to a well-to-do person. He then expressed his intention to give charity, so he went out with charity and placed it in the hand of a thief. In the morning, the people were talking and saying: Charity was given to a thief. So (one of the persons) said: 0 Allah, to Thee be the praise (what a misfortune it is that charity has been given to) the adulteress, to a rich person. to a thief! There came (the angel to him) and he was told: Your charity has been accepted. As for the adulteress (the charity might become the means) whereby she might restrain herself from fornication. The rich man might perhaps learn a lesson and spend from what Allah has given him, and the thief might thereby refrain from committing theft.
Reported by Muslim (No. 1022), Al-Bukhari (No. 1421), An-Nasa’i (No. 2523) and Ahmad (No. 7933).
Abu Hurayrah (may Allah be pleased with him) reported: The Messenger of Allah (may Allah's peace and blessings be upon him) said: "A man said: 'Indeed, I will give in charity.' So he took his charity out and placed it in a thief's hand. Next morning, people were saying: 'Charity was given to a…
" قال رجل لأتصدقن بصدقة، فخرج بصدقته، فوضعها في يد سارق، فأصبحوا يتحدثون: تصدق على سارق! فقال: اللهم لك الحمد لأتصدقن بصدقة، فخرج بصدقته، فوضعها في يد زانية؟! فأصبحوا يتحدثون: تصدق على زانية فقال: اللهم…
Narrated by Abu Hurayrah
AuthenticMuttafaq ‘alayh (Bukhari and Muslim)Mishkat al-Masabih 1876