Co-authoring a paper with a persona non grata Suppose Researcher A did some joint work with Researcher B. While the work was still in progress, or the manuscript was in preparation, researcher B became persona non grata in Academia, due to wrongdoing. I don't think the exact nature of wrongdoing is relevant here, but let's say it is serious, as in for example:

faking research results (the research with A was not faked)
severely breaching research ethics (the research with A was not affected)
sexual misconduct towards subordinates (that Researcher A was not aware of during joint work)

What's Researcher A to do? I see four options, all of which have their ethical and practical drawbacks.

publish the result jointly with B as planned. The ethical drawback is that it can be perceived as siding with B in the scandal/breaching a boycott, and the  practical one is that Researcher A's career might suffer from association with the scandal.
not publish at all. The practical drawback is that Researcher's A CV suffers, and the ethical drawbacks are obvious: not publishing a worthy research funded by taxpayers is a waste of their money; it may hinder further progress of the field, and, for example, in Maths, if results have been announced or communicated to the community, then codes of conduct explicitly require that the details are published soon.
withdraw Researcher A's name. The practical drawback is as above, and the ethical drawback is that generally nobody should receive full credit for the work that was in fact joint, and even less so as a &quot;reward&quot; for the misconduct.
ask/pressure Researcher B to withdraw their name. The practical concern is that Researcher B may not agree, and the ethical one is that, again, Researcher A should not get more credit than their contribution to the work, and wrongdoing should not disqualify B from getting their share of credit where it is due.

So, what is the right course of action for A, ethically and practically?
I expand on a comment by Buffy where this was hinted at:
It is a very different issue whether the misconduct was on the scientific level, which would cast doubt on the results, or on the social/moral level.
In the first case, it is difficult to trust the results if B is on the author list. Here, we have a serious dilemma. Probably OP might want to consider to cut their (and everybody's losses). Perhaps there is a way to publish it that makes it explicitly clear that this work has not been tainted by misconduct (editors note etc.).
To the second point:
Reiser's filesystem, Bieberbach's or Teichmüller's achievements are not devalued by their personal moral failings.
In this case, the research is done. It should be published. I do not know how important or impactful it is, but in principle, it's always a service to science and humanity, not just the respective taxpayer. Ultimately it's the OP's decision whether they are prepared to accept possible flak for their step. The research is separate from the authors behaviour. It's their detractors that would be trying to mix science and mores.
The only exception I can imagine for research to be suppressed for moral failures would be if the data were obtained in a clearly unethical way. The purpose of this is to discourage incentives for future breaking of ethical rules for obtaining it.