Hafetz Haim Halachot
Halacha 27 / 215

Hilchos Lashon Hara, Opening – positive commands (3)

Sometimes lashon hara also breaks the positive commandment (Vayikra 19:15), "Judge your fellow charitably."

For example, he saw another person do something that can be judged two ways: badly - that he did something wrong - or favorably - that he did not necessarily do anything wrong. It is a positive Torah commandment to judge him favorably, so that the other person comes out as not having done anything wrong.

If someone speaks lashon hara instead of judging favorably, or believes lashon hara instead of judging favorably, he breaks this positive commandment.