Hilchos Lashon Hara chapter 4, section 8

When Beit Din instructs a person in a particular way that involves a physical action, whether it relates to this person in his relationship with G-d or to his interpersonal relationship with others and this person absolutely refuses to abide the Beit Dins’s instructions and gives no reason why he won’t comply, then it is permissible to publicly humiliate him for his actions and even to record his evil lifestyle in the community’s archives for all future generations to view. But if this person responds with a defense that justifies his refusal to comply in a framework of reason that are personal, then the law is as the follows: If we believe that the reason he gave for not complying is untrue and was offered only in an attempt to convince the Beit Din to drop the matter, then we do not have to believe him and it is permissible to denigrate him. But if we are unsure of the truthfulness of his reasons for refusing to comply, then it is forbidden to shame or humiliate him.