Why did God Create Devil or Satan?
“The answer is that God Almighty has for the purpose of testing man appointed two spiritual callers; one caller to good whose name is the Holy Spirit and the other caller to vice, whose name is Iblis and Satan. These two callers only call to good or evil but do not exercise any compulsion as is indicated in the verse:
فَاَلۡہَمَہَا فُجُوۡرَھَا وَتَقۡوٰٮہَا
This means that God reveals the wrong and the right….
The means of revealing the wrong is Satan, who makes evil suggestions, and the means of revealing the right is the Holy Spirit, who puts pure thoughts in the heart. As God Almighty is the Cause of causes He has attributed both these types of revelation to Himself because all this system is instituted by Him. Otherwise, what power would Satan have to make evil suggestions to anyone’s heart and what power would the Holy Spirit have to guide anyone along the paths of righteousness?
Our opponents the Aryas, the Brahmus and the Christians, out of their short-sightedness, raise an objection to the teaching of the Holy Qur’an that according to it God Almighty has Himself set Satan after man and thus He desires to mislead mankind, but this is a mistake. They ought to know that the Holy Qur’an does not teach that Satan can exercise compulsion for leading anyone astray. Nor is it the teaching that Satan is appointed only for the purpose of calling to evil. The teaching is that this is a trial and a test. Man has been equally bestowed the touch of angels and the touch of Iblis, one calling to good and the other to evil so that being confronted with this trial man should acquire merit or should become subject to chastisement. If only one type of means had been provided, for instance, if all man’s external and internal emotions had drawn him only towards good, or if his nature had been such that he would not have been capable of doing anything except good, then there was no reason that he could have been awarded any rank of nearness to God on account of his good actions, inasmuch as all his means and emotions would have been for doing good and the desire of evil would from the beginning have been absent from his nature. In such case by what right could he have deserved merit for avoiding vice?
For instance, if a person who from the beginning lacks sexual power and has no desire for women, should claim that he passed a certain time in the company of young beautiful women, but that he is so pious that he did not look upon them with desire even once and feared God all the time, there is no doubt that everyone would laugh at him. They would inquire from him when did he possess such power, for restraining which he could take pride in himself or could hope for merit.
It should be realized that in his elementary and intermediary conditions all hopes of merit of a seeker are created by opposing emotions and if in those stages his nature should be such that he cannot commit any vice, he cannot deserve any merit either. For instance, our systems do not secrete, like scorpions and snakes, a kind of poison through which we could hurt anyone like scorpions and snakes. We cannot, therefore, deserve any merit in the estimation of Allah by refraining from causing such harm.
This shows that opposing emotions which pull a person towards vice are the cause of merit for him, for when out of fear of God he discards such emotions, then he becomes worthy of praise in the estimation of God and wins His pleasure. He who arrives at the extreme point of virtue and is rid of all opposing motions as if his Satan had become a Muslim, would still deserve merit for he has traversed the stages of trial with great courage. A righteous person who in his youth has accomplished many great works receives merit for them even in his old age.”
Excerpted from The Essence of Islam Volume II (pp 182–184)