The problem of evil: How does an infinitely merciful & compassionate Allah create an evil Shaitan to plague us every day of our lives?
First of all, please note that Satan is not the only bad creature. The history can tell you a long list of many humans who killed many innocents and/or misdirected their followers. Qur'an also says we should seek refuge to the Lord, not only from the devil we cannot see, but also from the devils we see among humans:
1.Say: "I seek refuge with (Allah) the Lord of mankind, 2. The King of mankind, 3. The Illah (God) of mankind, 4. From the evil of the whisperer (devil who whispers in the hearts of men) who withdraws (from his whispering in one's heart after one remembers Allah), 5. Who whispers in the breasts of mankind, 6. Of jinn and mankind. - Surah An-Nas
But why these extremely bad creatures are created by God?
None of them were bad just after they were created. As @owari answered, Satan was worshipping the Lord for a very long time. But it was free to make good or bad choices, and once it made bad choice when Human was created (as @owari referenced)
None of the murderers were bad people just after born. They were cute and innocent children, but they were free to make good or bad choices, and they made bad choices during their lives.
Why God made Satan or murderers free to make bad choices?
The freedom to make choices is one of the great gifts of the Lord to the creatures. Without it, belief or worship of the Lord would be of zero value, because it would be just of force, not choice.
Allah is Just so He creates anything creatable as soon as there is a cause for it to exist based on the causality principles. Satan was creatable so was created, a mercy toward Satan as one creature of Him. Note that Allah is Ar-Rahman which means have mercy toward every living and non-living species that He creates, every Muslim and non-Muslim, every human and non-human, and etc.
Satan was not created as devil, his name is Hareth indeed, he was created as a Jinn and left free to choose between good and bad, he was good until in a hard (for him) examination of Allah he failed and chose the wrong, then he chose to remain bad and an enemy of the human being. We are also all created as humans, not good or bad, we ourselves earn attributes based on our choices in our real everyday life.
وَإِذْ قُلْنَا لِلْمَلَائِكَةِ اسْجُدُوا لِآدَمَ فَسَجَدُوا إِلَّا إِبْلِيسَ كَانَ مِنَ الْجِنِّ فَفَسَقَ عَنْ أَمْرِ رَبِّهِ أَفَتَتَّخِذُونَهُ وَذُرِّيَّتَهُ أَوْلِيَاءَ مِن دُونِي وَهُمْ لَكُمْ عَدُوٌّ بِئْسَ لِلظَّالِمِينَ بَدَلًا
Behold! We said to the angels, "Bow down to Adam": They bowed down except Iblis. He was one of the Jinns, and he broke the Command of his Lord. Will ye then take him and his progeny as protectors rather than Me? And they are enemies to you! Evil would be the exchange for the wrong-doers! [18:50]
- It was conflicting with God's mercy and compassion if there was set any dominance put aside for Satan over us, but according to Quran Satan and his group has no dominance over the human being until we accept their obedience and go after them:
وَقَالَ الشَّيْطَانُ لَمَّا قُضِيَ الْأَمْرُ إِنَّ اللَّهَ وَعَدَكُمْ وَعْدَ الْحَقِّ وَوَعَدتُّكُمْ فَأَخْلَفْتُكُمْ وَمَا كَانَ لِيَ عَلَيْكُم مِّن سُلْطَانٍ إِلَّا أَن دَعَوْتُكُمْ فَاسْتَجَبْتُمْ لِي فَلَا تَلُومُونِي وَلُومُوا أَنفُسَكُم مَّا أَنَا بِمُصْرِخِكُمْ وَمَا أَنتُم بِمُصْرِخِيَّ إِنِّي كَفَرْتُ بِمَا أَشْرَكْتُمُونِ مِن قَبْلُ إِنَّ الظَّالِمِينَ لَهُمْ عَذَابٌ أَلِيمٌ
And Satan will say when the matter is decided: "It was Allah Who gave you a promise of Truth: I too promised, but I failed in my promise to you. I had no authority over you except to call you but ye listened to me: then reproach not me, but reproach your own souls. I cannot listen to your cries, nor can ye listen to mine. I reject your former act in associating me with Allah. For wrong-doers there must be a grievous penalty." [14:22]
إِنَّ عِبَادِي لَيْسَ لَكَ عَلَيْهِمْ سُلْطَانٌ إِلَّا مَنِ اتَّبَعَكَ مِنَ الْغَاوِينَ
"For over My servants no authority shalt thou have, except such as put themselves in the wrong and follow thee." [15:42]
وَاتْلُ عَلَيْهِمْ نَبَأَ الَّذِي آتَيْنَاهُ آيَاتِنَا فَانسَلَخَ مِنْهَا فَأَتْبَعَهُ الشَّيْطَانُ فَكَانَ مِنَ الْغَاوِينَ
Relate to them the story of the man to whom We sent Our signs, but he passed them by: so Satan followed him up, and he went astray. [7:175]
I just want to quote from tafseer Al-mizan by grand allamah tabataba'i, a contemporary Islamic philosopher:
Guidance, righteous dead, obedience is realized when misguidance, sinful deeds and arrogance exists. The invitation to guidance is complete when an invitation to misguidance also exists...
Therefore, until there are human beings on earth, there should be iblis and its allies to invite people to misguidance.
This answers the question of why he has been given the time to misguide the people. About his creation though @owari has elaborated. You can refer to the tafseer of Surah a'raf 1:25 to read more about this (unfortunately only in Persian and Arabic for now).
Hope this helps,