Surah 7 al-araf verse 11-17
11. It is We who created you and gave you shape. Then we bade the angels prostrate to Adam. They did so, Not so Iblis; He refused.
12. "What prevented you from prostrating when I commaded you?" He said "I am better than him; you created me from fire and him from clay."
13. "Get down from it, it is not for you to be arrogant here. Get out, for you are malicious.
14. He said "Give me respite till the day they are raised up."
15. "Be you among those who have respite."
16. He said "Because you have thrown me out, I will lie in wait for them on your straight way.
17. Then will I assault them from before them and behind them and from their right and their left; Nor will you find in most of them, gratitude (for your mercies)."
Iblis used his free will to choose a path that disobeyed God. Why did God give him respite? because God is merciful and compassionate to all his creation. The time that we have been given can be used for good, perchance, offsetting our errors. But some of us, in our arrogance and pride may refuse---and be ungrateful for God's mercies, just like Iblis. But if God is omnipotent, why give Iblis the opportunity to "assault" us on the straight way? Why not take away Iblis's free-will so that they will only be observers? Human beings naturally tend to view the world from a Human-centric perspective---everything should be for our well-being/convenience. But taking away free-will also means taking away the chance to repent. Would that not be an injustice? God's justice is for all of his creations.
This life is only a respite. We can use Iblisi logic, and in our arrogance and pride, disregard goodness---or we can walk on the Guided path. Blaming "evil" on God is simplistic. Iblis does not have any power except that which we give them. Because of our free-will, we are fully empowered to determine the course our life here on earth takes.