Allah knew that Iblis was not going to obey Him in prostrating before Adam. Allah could have totally annihilated him or turned him into a handful of dust or stifled the refusal in his mouth. Yet, Allah gives His commissioned creatures absolute freedom even to the extent that they can refuse Allah the Almighty’s commands. He grants them the freedom of denial, disobedience, and even disagreement with Him.
His kingdom will not diminish if the disbelievers do not believe in Him, nor will it be extended if many people believe in Him. On the contrary, the disbelievers will lose, and the believers will gain, but Allah is above all of that.