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.
"When a person dies, his works end, except for three: ongoing charity, knowledge that is benefited from, and a righteous child who prays for him."
Prophet Mohammed (PBUH)
"The best of what a man leaves behind are three: a righteous child who supplicates for him, ongoing charity the reward of which reaches him, and knowledge that is acted upon after him."
Sunan Ibn Mājah
"Every day two angels come down from Heaven and one of them says, 'O Allah! Compensate every person who spends in Your Cause,' and the other (angel) says, 'O Allah! Destroy every miser.'"
Sahih Bukhari