Our Gemara on Amud Aleph and Beis discusses tricks that connivers may engage in to avoid paying tithes, Peah (corner of field left for the poor) and the like, such as declaring their field ownerless:
אִי הָכִי, אֲפִילּוּ מִיּוֹם הָרִאשׁוֹן נָמֵי לֶיהֱוֵי הֶפְקֵר! אָמַר רַבָּה: מִפְּנֵי הָרַמָּאִין, דְּמַפְקִירִין וְהָדְרִין בְּהוֹן.
The Gemara asks: If so, then let the Sages institute that the item is considered ownerless even from the first day as well and that he cannot retract his declaration at all. Rabba said: The reason that the Sages did not render the item ownerless from the first day is due to the swindlers, who declare the field ownerless in order to render the produce of the field exempt from the requirement of tithing, and then retract that declaration and immediately reclaim the field. Therefore, the Sages instituted that ownerless status takes effect only after three days.
According to this discussion in the Gemara, the rabbis sought to thwart a would-be trickster by making the ownerless declaration not valid until 3 days.
One may ask, if a person uses a legitimate legal loophole, what is the concern? Certain aspects of halakha rely on loopholes such as the Pruzbol (Mishna Gittin 4:3) of the Mishna, or a later development such as selling chametz to a gentile before Pesach. So, how do we determine when to exploit a loophole and when to close it?
On a simple level, it is important to understand that when halakha functions as law, it takes on characteristics of law, even secular law. This is because law is a human process and follows particular considerations that serve social means, and as such, also are bound to human concepts and limitations. For example, the halakha might state such and such an oath is forbidden, but Humans must still decipher and interpret the intent (see Nedarim 30b). Or, we may have a tradition regarding the forms of the Hebrew letters for a Torah, requirements of the parchment and ink. Yet, the laws of physics will dictate whether or not the material will congeal and harden and adhere to the parchment.
Law, by nature, must operate by rules, which means it is subject to generalities. The more specific you try to be with Law, the more verbose and onerous it becomes, and there must be a limit to that. To some degree, all law requires a certain amount of application and common sense and cannot be fully dictated in any particular code. This is why there is Torah Sheba’al Peh, and some thing that still remains not codified, what is known as the “5th Volume of Shulkhan Arukh”. Law cannot be law without interpretation, and rules will always in some way be used to subvert the system or at least work around it when necessary. This is not a flaw, but intrinsic within the design in order to allow for occasional workarounds abd because the law cannot be specific enough to coverecety concern and contingency.
Continuing this analysis in a simple fashion, we can say that the rabbis allowed for Pruzbol and other loopholes, and have sanctioned it over the years because they weighed the benefits versus the losses, and saw an ultimate preservation of the law. That does not in any way suppress them from at times working specifically to close loopholes. If the rabbis believed certain loopholes are being anused and if they think it serves the social and spiritual aims to prevent the loophole from being exploited. The rabbis’ job throughout Jewish history is to maintain and conserve the law using their judgment.
I also will add that the rabbis might have also seen a particular indication from Torah ethics to not allow for loopholes regarding charitable contributions. There is a teaching in Gemara Shabbos (23a) that discusses how the verse uses a particular language to prevent and block tricksters from depriving the poor of Peah. Our Gemara on Amud Beis also discusses exceptions to the rule where declaring something ownerless will not work by Peah, even as a loophole, (though it works by maaser) according to special inferences “You shall abandon” (see Chullin 134b). Perhaps the rabbis felt that this was enough impetus to show a special sensitivity to the issue of loopholes regarding gifts to the poor, and then by extension, possibly to all tithes be they to the poor or to Levites etc. Of course you might ask, why did the Torah leave the loophole available? That is not really a question, because perhaps sometime in the future unknown to us, they might be an exigency that requires this loophole anyhow, and at that time the rabbis would be able to use it. It’s not that they wouldn’t be allowed to use the loophole at all, rather they just saw that the Torah was extra sensitive to not overuse the loophpole, even in a situation when ordinarily one might do so.