The Rambam codifies the biblical prohibition of lo techanem (Deut. 7:2), which includes a ban on giving free gifts to idolaters, granting them favor, or allowing them to settle in ways that strengthen their presence — all of which inform whether paying a church for services crosses a prohibited line.
מִכָּאן אַתָּה לָמֵד שֶׁאָסוּר לְרַפְּאוֹת עַכּוּ"ם אֲפִלּוּ בְּשָׂכָר. וְאִם הָיָה מִתְיָרֵא מֵהֶן אוֹ שֶׁהָיָה חוֹשֵׁשׁ מִשּׁוּם אֵיבָה מְרַפֵּא בְּשָׂכָר אֲבָל בְּחִנָּם אָסוּר. וְגֵר תּוֹשָׁב הוֹאִיל וְאַתָּה מְצֻוֶּה לְהַחֲיוֹתוֹ מְרַפְּאִים אוֹתוֹ בְּחִנָּם: אַף בְּמָקוֹם שֶׁהִתִּירוּ לְהַשְׂכִּיר לֹא לְבֵית דִּירָה הִתִּירוּ מִפְּנֵי שֶׁהוּא מַכְנִיס לְתוֹכָהּ עֲבוֹדַת כּוֹכָבִים וְנֶאֱמַר (דברים ז כו) "לֹא תָבִיא תוֹעֵבָה אֶל בֵּיתֶךָ". אֲבָל מַשְׂכִּיר לָהֶן בָּתִּים לַעֲשׂוֹתָן אוֹצָר. וְאֵין מוֹכְרִין לָהֶן פֵּרוֹת וּתְבוּאָה וְכַיּוֹצֵא בָּהֶן בַּמְחֻבָּר לַקַּרְקַע. אֲבָל מוֹכֵר הוּא מִשֶּׁיָקֹץ אוֹ מוֹכֵר לוֹ עַל מְנָת לָקֹץ וְקוֹצֵץ. וּמִפְּנֵי מָה אֵין מוֹכְרִין לָהֶן שֶׁנֶּאֱמַר (דברים ז ב) "וְלֹא תְחָנֵּם" לֹא תִּתֵּן לָהֶם חֲנִיָּה בַּקַּרְקַע שֶׁאִם לֹא יִהְיֶה לָהֶם קַרְקַע יְשִׁיבָתָן יְשִׁיבַת עַרְאַי הִיא. וְכֵן אָסוּר לְסַפֵּר בְּשִׁבְחָן וַאֲפִלּוּ לוֹמַר כַּמָּה נָאֶה עוֹבֵד כּוֹכָבִים זֶה בְּצוּרָתוֹ. קַל וָחֹמֶר שֶׁיְּסַפֵּר בְּשֶׁבַח מַעֲשָׂיו אוֹ שֶׁיְּחַבֵּב דָּבָר מִדִּבְרֵיהֶם שֶׁנֶּאֱמַר וְלֹא תְחָנֵּם לֹא יִהְיֶה לָהֶם חֵן בְּעֵינֶיךָ, מִפְּנֵי שֶׁגּוֹרֵם לְהִדַּבֵּק עִמּוֹ וְלִלְמֹד מִמַּעֲשָׂיו הָרָעִים. וְאָסוּר לִתֵּן לָהֶם מַתְּנַת חִנָּם אֲבָל נוֹתֵן הוּא לְגֵר תּוֹשָׁב שֶׁנֶּאֱמַר (דברים יד כא) "לַגֵּר אֲשֶׁר בִּשְׁעָרֶיךָ תִּתְּנֶנָּה וַאֲכָלָהּ אוֹ מָכֹר לְנָכְרִי", בִּמְכִירָה וְלֹא בִּנְתִינָה:
From the above, we can infer that it is forbidden to offer medical treatment to an idolater even when offered a wage. If, however, one is afraid of the consequences or fears that ill feeling will be aroused, one may treat them for a wage, but to treat them free is forbidden. [With regard to] a ger toshav, since we are commanded to secure his well-being, he may be given medical treatment at no cost. Even when it is permitted to rent [homes to idolaters], it is not permitted to rent to them for use as a dwelling, because they will bring idols into them, as [Deuteronomy 7:26] states: "Do not bring an abomination into your home." It is, however, permitted to rent them homes to use as storehouses. It is forbidden to sell them fruit, grain, or other produce while it is attached to the earth. One may sell [these products] after they have been harvested or [before they have been harvested], on the condition that they will be harvested, and he must harvest them. Why is it forbidden to sell them [land or anything attached to the land]? Because [Deuteronomy 7:2] states: "Do not be gracious with them." [This phrase can also be interpreted:] "Do not give them a resting place in the land." As long as they do not have a resting place in the land, their stay will be a temporary one. [This prohibition also] forbids speaking about [idolaters] in a praiseworthy manner. It is even forbidden to say, "Look how beautiful that idolater's body is." How much more so is it forbidden to praise their deeds or to hold their words dear, as [the phrase states]: "Do not be gracious with them." [This phrase can also be interpreted:] "Do not look at them graciously," for doing so will cause you to draw close to them and learn from their wicked behavior. [Also implicit in the above phrase is that] it is forbidden to give them a present. A present may, however, be given to a ger toshav, [as implied by Deuteronomy 14:21:] "You may give it to the stranger in your gates so that he may eat it; or sell it to a gentile," [i.e., to an idolater]; it should be sold, not given.