"Give to the devout, but do not help the sinner." (Sirach 12:4)
If you do good, know to whom you do it, and you will be thanked for your good deeds. Do good to the devout, and you will be repaid - if not by them, certainly by the Most High. No good comes to one who persists in evil or to one who does not give alms. Give to the devout, but do not help the sinner. Do good to the humble, but do not give to the ungodly; hold back their bread and do not give it to them, for by means of it they might subdue you; then you will receive twice the evil for all the good you have done. A friend is not known in prosperity, nor is an enemy hidden in adversity.
The Catechism draws from Sirach 12 the principle of discernment in charity: generosity is a virtue but it does not require the absence of prudential judgment about how the gift will be used (CCC 2447).
Brothers and sisters, know to whom you do good. Generosity does not mean indiscriminate giving without attention to what the gift enables. The gift given to one who will use it to do harm is a gift against the community it damages. Discern your giving. Give generously and wisely, not generously and blindly.
Lord God, give us generous and wise hearts that give discerningly as well as freely. Through Christ our Lord. Amen.