Allah, The Glorious, created human beings and granted them the ability to be good if they want, or to be bad if they insist on doing bad. In Quran ( We Have guided the human being to the right path, to chose whether to be grateful or disgraceful) Sura Al-Insan, Verse 3.
Allah (SWT) gives all human beings the option to choose their faith and deeds, after guiding them to the Truth. They will meet the results of their option in this life and hereafter.
No doubt that Allah knows who will be grateful and who will be disgraceful, but His knowledge does not make Him cancel the existence of those who will be bad, or stop their creation, because it will be against justice to punish the sinners to be before committing the sin.
Evil people prove the qualities of good people and with out bad people, it will be difficult to identify the good persons.