Wa `alaykum as-Salamu wa Rahmatullahi wa Barakatuh.
You are right in saying that we ought not to repel the beggar. Allah has ordained the laws for the ultimate wellbeing of humankind. So, the Islamic teaching not to turn the beggar away is intended to teach us to share the blessings with the less fortunate.
Allah says, “in their wealth is a share for those who seek assistance and the destitute.”
In other words, while we ought to help those who are desperate and forced to beg, we should not give money to those who use it to buy alcohol or drugs or any other haram purposes. By doing so, we are condoning haram, which is equally sinful.
Having said this, I must caution against suspicion; we do not assume things. Instead, we should verify it.
In case of doubt, it is best to provide the person food or coupons which they can use only for legitimate purposes.
Almighty Allah knows best.
Views expressed by hosts/guests on this program (live dialogue, Facebook sessions, etc.) are their own and their appearance on the program does not imply an endorsement of them or any entity they represent.