^Bro, I think the incident you're referring to is when he had eaten something that had been bought with unlawful money, not sadaqah.. Lemme just check to make sure.
Nvm, here are two hadiths, one I was mixing up with what you're asking about
:
It has been reported that once Sayyidna Abu Bakr drank a little milk given by his female slave and asked her about it. She said : I prophesied to a people who gave it to me for that. Then he thrust the fronts of his fingers into his throat and vomited in such a way that his life was in danger. Then he said :O Allah, I pray to You for forgiveness of what remains attached to my throat and to my stool. In another narration, it is said that when Rasulullah (sallallaho alaihe wasallam) was informed of it, he said : Don’t you know that Abu Bakr does not allow anything to his belly except lawful food ?
In a similar way, Sayyidna Omar drank the milk,by mistake, of a camel that was
belongs to Zakat fund. He thrust his fingers into his throat and vomited it, Sayyida Ayesha said : You are heedless of the best divine service. That is to be safe from eating unlawful food.
source
Of course, zakat is very different than sadaqah, and is given to prescribed people in prescribed amounts, so anyone who does not have a share in it is forbidden from taking it.