>>17996488 (OP)
I guess it is like this. If Ravan did not exist, Lord Ram would not be remembered, the Ramayana would have never have been. Without the crucible of the Mughals, the Khalsa would have never have come into existence. If we did not hate and indulge in evil, we would never have the opportunity to overcome hate and evil.
"And God saw that it was good." Have trust in the plan. This world is good.