This is my attempt to develop a moral framework to giving money to the poor.
Part of the messiness of life take the form of poverty and how men of means are to assist the poor. The common complaint about giving money to the poor is that they will use it for some evil addiction.
Consider the nature of cooperation in evil by analogy. A man that gives a gun so that he may murder someone is cooperating with him in murder formally, that is he intends the evil itself. A man that gives a gun to a man who will use it to murder another though does not intend the evil itself cooperates with him materially in murder, that is he intends the matter or potential for the evil, but not the evil in itself.
Material cooperation can be further divided. A man who gives the gun knowing that he will use it to murder while not intending the murder engages in proximate material cooperation, he intends not the act but intends the potential for the evil. A man who gives the gun not knowing its use for murder engages in remote material cooperation, that is he intents the potential but not for the evil.
Formal and proximate material cooperation in evil are always evil and wrong. Remote material cooperation is not a get out of jail free card, but requires a grave and serious act of prudence. Investing $100 in the S&P500 is at best an act of material cooperation in evil since many if not all of those companies are engage in or promoting evil and often grave evils. However, the size of the amount relative to the total is extremely small and has little impact and the companies are engaged in numerous positive goods as well. One must weigh whether there is some proportionate good to be had in light of the evil and this only under the supposition that the investor does not intend the evil, which no proportionate good can make licit.
In the case of the poor. Giving a drunk money so that he will get drunk is formal cooperation in the evil of drunkenness. Giving a drunk money knowing that he will use it for getting drunk though not intending that is an act of proximate material cooperation. Giving a man who is not discernibly a drunkard money who however intends to use it to get drunk or later decides to use it to get drunk is an act of remote material cooperation.
In the case of the poor, there are several acts of prudence necessary. The first is to distinguish whether or not someone is likely to use the money for illicit purposes. If one has good reason to be not or no good reason to suppose they will, there is still an act of prudence in the possibility of remote cooperation.
There seems no clear answer other than a large amount of prudence, that is good judgement. However, in general it is good to support charities that frequently interact with the poor, which avoids many of the moral hazards of giving directly to the poor.