Nabi Yusha’ (alaihis salaam) once received revelation that one hundred thousand people from his nation will be destroyed in a punishment to befall them. The strange thing was that sixty thousand of them were sinners and transgressors, whereas the remainder forty thousand were outwardly pious people. In astonishment Yusha’ (alaihis salaam) asked: “O Allah, what crime did the pious ones commit?” Allah Ta’ala replied: “They freely associated and interacted with the evil doers and did not express any type of anger or aversion for the wrongs taking place around them.” (Al-Bahrul Muheet vol. 3 pg. 533)
Lesson: Though one will not hate the sinner, one MUST hate the sin. If the situation is such that one cannot stop the wrong, one must feel the deep hate and aversion for the wrong that is taking place. He should also express this in an appropriate way – the least is to disassociate from the people involved and the place of sin.