The Talmud says that the Second Temple was destroyed because "senseless hatred" [sin'at chinam] prevailed. Yoma 9b
אבל מקדש שני שהיו עוסקין בתורה ובמצות וגמילות חסדים מפני מה חרב מפני שהיתה בו שנאת חנם ללמדך ששקולה שנאת חנם כנגד שלש עבירות ע"ז גלוי עריות ושפיכות דמים
The use of the word "senseless" implies that there is hatred that makes sense. What is it?
The following help, but do not fully answer the question. Any other sources?
Rashi says “senseless hatred” is hatred of people who have not committed any action justifying the hatred. [Rashi on Shabbat 32b] And what are those actions? Talmud: You may bear ill will towards someone if you witnessed him engaging in an act forbidden by the Torah. [Pesachim 113b]. However, you must assist him quickly, before assisting those you love [so that the ill will does not turn to hatred.] [Bava Metzia 32b]. Now, how do you know that you have reached the point of hatred? When you do not speak to your fellow for three days because of enmity. [Sanhedrin 27b]