Satan was created for important purposes. First of all, if Satan did try continually to seduce humanity, our creation would have been meaningless and futile. God has innumerable servants who cannot rebel and therefore do whatever they are commanded. In fact, the existence of an absolute Divine Being Who has many beautiful Names and Attributes requires, not by way of external necessity but due to the essential nature of His Names, that His Names be manifest.  He manifests all of His Names only through humanity.
Since He has free will, He gave us free will, by which is meant the ability to choose between alternatives. In addition, God endowed us with great potentials. The purpose of the constant inner and outer struggles that we face is the direct result of our ability to choose and to develop those potentials. Just as God sends hawks upon sparrows so that the latter can develop their potential to escape, He created Satan and allowed him to tempt us so that we can rise to higher spiritual ranks and strengthen our willpower by resisting temptation. As hunger stimulates people and animals to further exertion and discovery of new ways to be satisfied, and fear inspires new ways of defence, Satan's temptations cause us to develop our potentials and to be alert against sin.
Angels do not rise to the higher spiritual ranks, for Satan cannot tempt them or lead them astray. Animals have fixed stations, meaning that they can neither ascend or descend. Only humanity is faced with an infinite number of ranks or stations, and only we can rise or fall accordingly. There is an infinitely long line of spiritual evolution between the ranks of the greatest Prophets and saints down to such people as Pharaoh and Nimrod.
Given this, we cannot claimed that the creation of Satan is an evil. Although Satan is an evil creature, God's creation involves the whole universe and should be understood in relation to the results, not only with respect to the acts themselves. Whatever God does or creates is good and beautiful either in itself or in its effects. For example, rain and fire produce many effects, almost all of which are useful. If some people are harmed by water and fire through their own abuse of them, we cannot claim that their creation is not wholly good. Similarly, the main purpose for creating Satan is to enable us to develop our potentials, strengthen our willpower by resisting temptation, and to rise to higher spiritual ranks.
Some argue that many people fall into unbelief and so enter Hell because of Satan's temptations. To such people, I respond: Although Satan was created for many good and universal purposes, people can be deceived by him. However, Satan cannot compel us to commit a wrong or a sin; his power is limited to that of suggestion and encouragement. If we are so weak that we allow Satan to deceive us and thus follow him, it is our own fault that we end up in Hell. This is a suitable punishment for our misuse of an important faculty on which God conferred existence so that we can develop our potentials and achieve high spiritual ranks. Our task is to use our free will, which largely makes us human and allows us to have the highest position in creation, in the cause of intellectual and spiritual evolution. If we do not do so, it means that we complain of being honored with free will and of our own humanity.
Second, quality is far more important than quantity. Given this, we should consider qualitative (instead of quantitative) values when judging. For example, 100 date pits are worth only 100 cents as long as they remain as seeds. Their value can increase only if they are planted and grow into palm trees. But if only 20 actually grow into palm trees, can we say that it is "evil" to plant and water them? Clearly, it is wholly good to have 20 trees in exchange for 20 puts, since 20 trees will give 20,000 pits.
Again, say that 100 peahen eggs are worth 500 cents. But if only 20 eggs produce chicks, who would consider it an evil to risk producing 20 chicks at the expense of the other 80 eggs? On the contrary, it is wholly good to have 20 birds at the expense of 80 eggs, worth 400 cents, because those 20 chicks will be worth far more money, and some will even lay eggs.
The same is true with humanity. By resisting Satan and our evil-commanding selves, humanity has gained thousands of Prophets, countless saints and people of wisdom, knowledge, sincerity, and good morals. All of these people are the sun, moon, and stars of the human world. In exchange for such people, far more lower-quality pepole were lost.
 Such as the Creator, the All-Merciful, the All-Providing, the All-Living and Giver of Life, the All-Beautiful, and the All-Powerful, among others.