This is an interesting moral discussion, whether hypothetical or not. To my mind, the Mother did the correct thing in showing her child that some people are in a bad place and need help. The SW, professional or volunteer, was wrong, firstly for breaching client confidentiality, secondly for 'telling off' the woman who gave money, it is not hers or anyone else's business how people donate, and how people spend the received donations, and finally for watching this happening and not identifying herself to the man begging.
I don't give to anyone begging, I do however give to the Salvation Army and donate toiletries and such to the local Open Reach centre.