Here is an article that I think readers may find enlightening.
Tzedakah Giving – Torah Usually Precedes the Poor
by Rabbi Shlomo Shushan of Beit Shean
The Mitzvah of tzedakah is an important mitzvah and is part of g'milut chasadim (acts of loving kindness), which is the one of the pillars upon which the world stands. It also facilitates the existence of the other two pillars upon which the world stands – Torah and Prayer – because without donations to Torah institutions and synagogues, they would be hard to maintain.
In our time, there is a blossoming of Torah institutions in Israel, and simultaneously, there is, unfortunately, a rise in the number of families who are in need of financial assistance. We must determine who to give to and how to distribute our tzedakah funds.
There are differing opinions amongst halachic authorities as to the priorities of giving tzedakah (e.g. Baba Batra pg. 9, Tosfot "Sh'ne'emar", Bet Yosef Yoreh Deah 249, Aruch HaShulchan Yoreh Deah 249).
It is considered a great virtue to build and maintain a synagogue or a house of learning, and it is considered an urgent need to come to the aid of poor sick people.
The accepted majority view amongst halachic authorities is that if there are poor people who are literally starving, and the funds are designated to save them from dying or sickness, then they are the top priority, because we fear for their lives (safek pikuach nefesh).
However, in our time, it is rare to find a poor person who has nothing to eat. Therefore, only is cases of severe sicknesses would a poor person remain, according to Jewish law, the top priority.
In a case where the tzedakah money is designated to improve the welfare of a poor person but not save him from starvation, then there is no fear for his life and one should give first to the study of Torah which precedes even the maintenance of a synagogue.
However, if there is no synagogue or mikvah at all in the community, then their construction would precede giving to Torah institutions because they are a mitzvah relating to the entire community and they prevent various Torah prohibitions.
This same principle of an urgent communal need applies to supporting the mitzvah of settlement of the Land of Israel, in particular in Judea and Samaria, since this enterprise helps prevent the transfer of our homeland to foreigners G-d forbid. It is a mitvah relating to the entire community and also is considered an urgent mitzvah, and thus precedes other mitzvot.
Another issue in tzedakah-giving is verifying if the poor person asking is truly in need, or is he possibly a fraud. Giving tzedakah without any verification not only perpetuates and increases the problem of fraudulent paupers, but also leaves less money for those truly in need and thus causes a double problem.
If it is not possible to investigate, one should at least give a small donation in order not to turn the person away in shame (Rambam, Hilchot Ani'im, 7).
Our sages of blessed memory promise us that one who gives much tzedakah will never himself or his children be in need, and will receive an abundance of blessing.
This article originally appeared in the Kommemeyut parsha sheet, Yitro, 5770.