Why was Satan created?
This question has two aspects. One is the purpose of the creation of Satan and the other is the wisdom of the creation of him. Let us first dwell on the purpose of it briefly. As known, Satan is the same kind as jinns. According to the verse, I have only created Jinns and men, that they may serve Me (51/56), the purpose of the creation of jinns, like that of man, their having faith in Allah, their having advancement in worshipping and knowing Him. Just as there are misbelievers among men who fail the testing, so there are also among jinns who are misbelievers and fail the testing too. Satan is among the second group of jinns. He has been driven away from the divine mercy since he did not prostrate to Adam (PBUH) as Allah (SWT) commanded him to do, and, upon his request, he has been given permission, as a divine wisdom, to go after men to divert them from the right path.
The wisdom of giving Satan such a privilege is not one but many. The most important two are as follows: Allah Almighty is able to test man without the scruples of Satan as well, and again is able to load the duty of Satan onto the human self. Nevertheless, doing the opposite, by agreeing to the Satans heinous wish, which is to misguide people from the right path until the Doomsday, He has increased the torment for Satan in hell billion