The Catholic Church upholds the teachings of Jesus Christ when it comes to defamation, seeking to highlight the dignity of every human person.
The Catechism of the Catholic Church categorizes defamation under the Eighth Commandment.
This commandment from God covers a wide variety of offenses against the human person, always respecting their reputation.
At the same time, as the Catechism notes, there may be an "objectively valid reason" to disclose a person's faults publicly.
This isn't easy to decipher and in most cases, we shouldn't point out another person's faults publicly. Even Jesus himself asked us to resolve the dispute privately, before going to the courts.
Yet, even in this case, Jesus suggests that you "go to the Church" for help in resolving an issue, rather than trying to solve the problem publicly.
Defamation is a serious sin, one that goes against the commandments of God, but the best way to resolve such a conflict is always privately, away from the public eye.