A number of years ago there was a Rabbi of a well known congregation in Manhattan who joined in a prayer service in a church for President Obama. He received a lot of heat for his actions whereupon he wrote an email explaining that what he did was halachically mandated.
Today I came across an interesting tshuva of Rav Asher Weiss where he was asked his opinion on the matter. He started by saying that the Rabbi was absolutely wrong in going without asking a shyla first. Meaning, not every Rabbi is such a big talmid chochom and when they are faced with throny questions they should ask a greater authority for a psak. R' Asher was also not impressed with this Rabbi's defense of his actions which he said have no טעם וריח - taste or smell, and it was just a bunch of גיבובי דברים nonsensical words designed to defend his questionable behavior against his many attackers.
Rabbis are not Popes and are one hundred percent prone to criticism even more than the average layman, due to their position as examples for the community at large. The greatness of the halachic system is that every opinioin may be challenged if one follows the rules and strictures of halachic discourse [wide knowledge, precedent, sharp analysis etc.]. Certainly a grade b or c rabbi must be careful to consult with greater authorities before publicly acting in questionable ways.
Then R' Asher got down to business and discussed the essential question of the permissibilty of entering a church and partaking in a prayer service. R' Asher exhibited his trademark clarity, depth and breadth. He is geshmak. That is why he goes to places like Teaneck and the Five Towns and they eat him up despite his Charedi outlook and dress. His emes prevails.....
The prohibition against entering a church is only a rabbinic one, opening the door for leniency in cases where the absence of the Jew might lead to enmity. There is an opinion in the Rishonim that one may not even enter a church in cases of pikuach nefesh but the shulchan aruch doesn't rule that way. One must also consider that the reason for the rabbinic prohibition is that one might be suspected of serving their idols but in an instance when it is obvious that one is there just to show respect then the suspicion wouldn't be a concern. So if absolutely necessary there is room to be lenient.
However, one may not under any circumstances actually daven there. Here is the original for the scholarly amongst you. See also Marrrrrannnnnnn in the Yabia Omer [2/11] and the other sources quoted there.
My own, supra-halachic take.
You think the Chofetz Chaim would go to church to attend the wedding of the son of Prince Charles or for a mincha with Baracki?? The whole thing makes me uncomfortable. The church for me represents two thousand years of Jew hatred, a place of impurity and avoda zara [one of the three cardinal sins for which one must die, although R' Rabinovich of the Maalei Adumim Yeshiva, feels that b'zamn hazeh they don't really believe in the trinity anymore as real gods]. I think that a shul or beis medrash is a better place for a Jew to be.... Certain things might be strictly permitted but are still "pas nicht" - inappropriate.