Yirmiyahu requested that even when the goyim try to do something good and give charity, Hashem should send their way people who are not proper and don't deserve it so that they don't receive reward for their actions. The Nimukei Yosef comments that one does not receive reward for giving to aniyim who don't deserve it, only if he knows that they are not proper and don't deserve it. But, if one is approached with a request for tzedaka and he doesn't know the person and it is possible that he does deserve it, there is certainly reward for giving tzedaka under those circumstances (even if in truth the person did not deserve it). The Nimukei Yosef explains:
שהרי לשם מצו מכוין, ועוד דאי לא תימא הכי אתה נועל דלת בפני כמה מהוגנים במקום שאינם ניכרים
Based on this, the tefillah of Yirmiyahu is strange - he was asking Hashem to send their way people who they know don't deserve it, so that they won't receive reward for giving them tzedaka. If the givers realize that the receivers don't deserve it, why would they give them? Based on the nimukei yosef we see that there are 2 possible rewards for tzedaka, 1. for what the money accomplishes, 2. the good intent of doing it. Yirmiyahu knew about them that they would not be giving tzedaka l'sheim mitzvah, rather they would have some ulterior motives. Nonetheless, if the tzedaka ended up by someone who needed it, there would still be reward. Therefore, Yirmiyahu davened that Hashem should send them people who don't deserve it (even though the giver doesn't realize that they don't deserve it) so that they will not have reward for the intent or for the accomplishment.