If someone who is well respected in the community writes wonderful inspiring nigunim that are used in tefila, and then allegations appear that the individual is suspected of, or implicated in, serious wrongdoing, should those nigunim continue to be sung?
As stated previously, Rav Moshe Feinstein addressed this in Igros Moshe, Even HaEzer Vol. 1, § 96.
- If they were written when the fellow was acting properly, they are totally fine. (Rav Moshe talks about certain enactments the Mishna attributes to a Kohen Gadol who may later have gone apostate.) A sefer Torah may be the exception to this rule. Some have even attempted to track which tunes were written at which stage in the life of a controversial composer.
- A person whose core beliefs are correct but who has moments of weakness -- his music is still "kosher."
- I may use a computer architecture, vaccine, or socket wrench designed by a non-believing Jew, and refer to it by the inventor's name. If the tune was composed by someone with serious theological flaws, Rav Moshe feels it's "appropriate for an extra pious" person not to play that music at weddings, but fundamentally, wedding music is more like a socket wrench than a sefer Torah, and therefore still allowed.
Rav Moshe didn't address tunes for davening; one could attempt to argue that they are closer to a sefer Torah than wedding music ... I'd say that one depends on how people perceive it.
If the offense was actually victimizing people (which did not appear to be the allegations Rav Moshe was addressing), then a synagogue could plausibly say they want to send a strong message about it by choosing not to use it; similarly, if the Talmud says to avoid triggering behavior (mentioning the word "rope" in the presence of someone whose relative was recently executed), and one feels the tunes could emotionally harm someone in the synagogue, a case could be made for that too. But it's hard to say there's a categorical prohibition.
(As a chazan personally, given all of the above I make a reasonable attempt to choose less-controversial composers when possible.)
When the good and the bad are intertwined, the Jewish approach is to take the good and throw away the bad. In the Gemara [Chagigah 15b], Rabbi Meir continued to study under Elisha ben Avuya even though the latter had become a heretic:
He found a pomegranate, ate the inside and threw away the peel... He ate a half-ripe date and threw away the peel... Why are Torah scholars compared to nuts? To tell you: Even though this nut is soiled with mud and excrement, its content is not made repulsive, because only its shell is soiled; so too a Torah scholar, although he has sinned, his Torah is not made repulsive.