Quran 6:112 – Are Evil People Put On Purpose Into Societies By Allah?
Assalam-o-Alaikam: I think the purpose of humans on this Earth is to go through the test. The test can only be valid if there was devil and his followers trying to misguide people. I think the devil, its followers and free will is by design to create true test environment.