Hafetz Haim Halachot
Halacha 18 / 215

Hilchos Lashon Hara, Opening – negative commands (11)

Everything we wrote so far is about one speaker and one listener. But if a person joins a group of bad people who regularly speak lashon hara, in order to talk with them and hear from them, he also breaks the negative commandment (Shemos 23:2), "Do not go after the many for evil things." This forbids agreeing with or joining people who do wrong, even if there are many of them.

See later, paragraph 6 of the positive commandments: through this bad connection he also breaks a positive commandment.