Detraction is one of a number of related sins that the Catechism of the Catholic Church classifies as "offenses against truth." When speaking of most of the other sins, such as bearing false witness, perjury, calumny, boasting, and lying, it is easy to see how they offend against the truth: They all involve saying something that you either know to be untrue or believe to be untrue.
Detraction, however, is a special case. As the definition indicates, in order to be guilty of detraction, you have to say something that you either know to be true or believe to be true. How, then, can detraction be an "offense against the truth"?
The answer lies in the likely effects of detraction. As the Catechism of the Catholic Church notes (para. 2477), "Respect for the reputation of persons forbids every attitude and word likely to cause them unjust injury." A person is guilty of detraction if he, "without objectively valid reason, discloses another's faults and failings to persons who did not know them."
A person's sins often affect others, but not always. Even when they do affect others, the number of those affected is finite. By revealing the sins of another to those who did not know of those sins, we do damage to that person's reputation. While he can always repent of his sins (and might indeed already have done so before we revealed them), he may not be able to recover his good name after we have damaged it. Indeed, if we have engaged in detraction, we are obliged to try somehow to make reparation—"moral and sometimes material," according to the Catechism. But the damage, once done, may not be able to be undone, which is why the Church views detraction as such a serious offense.
The best option, of course, is not to engage in detraction in the first place. Even if someone should ask us whether a person is guilty of a particular sin, we are bound to protect that person's good name unless, as Father Hardon writes, "there is proportionate good involved." We cannot use as our defense the fact that something we have said is true. If a person does not need to know the sin of another person, then we are not free to divulge that information. As the Catechism of the Catholic Church says (paragraphs 2488-89):
The right to the communication of the truth is not unconditional. Everyone must conform his life to the Gospel precept of fraternal love. This requires us in concrete situations to judge whether or not it is appropriate to reveal the truth to someone who asks for it.
Charity and respect for the truth should dictate the response to every request for information or communication. The good and safety of others, respect for privacy, and the common good are sufficient reasons for being silent about what ought not be known or for making use of a discreet language. The duty to avoid scandal often commands strict discretion. No one is bound to reveal the truth to someone who does not have the right to know it.
We offend against the truth when we tell the truth to those who have no right to the truth, and, in the process, do damage to the good name and reputation of another. Much of what people commonly call "gossip" is in fact detraction, while calumny (the telling of lies or misleading statements about others) makes up much of the rest. The best way to avoid falling into these sins is to do as our parents always said to do: "If you can't say something nice about a person, don't say anything at all."