"And HE has already revealed to you in the Book that when you hear the Signs of God being denied and mocked at, sit not with those who indulge in such talk until they engage in some other talk; for in that case you would be like them. Surely God will assemble the hypocrites and the disbelievers in Hell, all together." [Quran 4:140]
First we might explain that a death penalty for blasphemy is not part of Islam. Such a death penalty is only the belief of some Muslims who are misguided and have warped their own religion. We could explain that most every religion has been interpreted differently as the people move farther from the original source of their religion and Book. When generations pass and have moved some distance from the time of the founder it happens that those who hold positions of religious power and are also supported by political and material power subjugate the divine teachings to their own sense of superiority. The religious hierarchy begin to impose their understanding upon others and even commit unpardonable excesses against humanity in the name of God. The history of Islam is not an exception to this and Christianity has the same background. The Christians, after enough time had passed between them and the time of Jesus, declared both apostasy and blasphemy crimes punishable by death. Many so-called heretics were killed by the Christians, all in the name of Jesus.
It also happened that at some point in time the Muslim leaders decided, in complete contradiction to the Quran and example of the Prophet, that blasphemy ought to be punishable to varying degrees including death. Such leaders were and are astray from the teachings of Islam.
I believe the Quran mentioned an event in the life of the Holy Prophet; once he was returning to Medina from an expedition during which the Muslims suffered much. Just before his return one of the leaders of the hypocrites (those who accepted Islam outwardly but did not actually believe) in Medina, Abdullah bin Ubayy bin Salul, who would likely have become leader of Medina had it not been for the arrival of Muhammad, declared that the most honorable in Medina would punish and expel the worst in Medina. He thought many of the people were fed up with Muhammad and it was clear that by the worst he meant the Holy Prophet. His words were reported to the Holy Prophet and the passions of his companions were enflamed. Some of them wanted to kill the man for the crime of speaking about the Prophet in the worst possible terms. It should be stated that at this time Muhammad was the authority in Medina. He was recognized as the judge. He held organizational, administrative and judicial authority. Muhammad rejected all such requests and declared no punishment would be meted out. Eventually, Abdullah bin Ubayy's son, a devout follower of the Holy Prophet, approached him and said words to the effect, "I suspect that you are rejecting all of the others lest I should be hurt. I suspect that you are doing this for my sake lest I should be hurt and later on in take revenge on my father’s killer. If that is the case then permit me to kill my own father." That is how agitated and 'I angry the Muslims were at the man who insulted the Holy Prophet. However, the answer was still, "no". The Holy Prophet would not allow blasphemy to be punished and even more astonishingly, when Abdullah bin Salul died, the Holy Prophet decided to lead the mans funeral prayer.
In the Quran, the belief that Jesus was the son of God is called monstrous, blasphemy of the highest order, but no call is made to punish those who accept that belief.
"And that it(the Quran) may warn those who say, 'God has taken unto Himself a son.' No knowledge have they thereof, nor had their fathers. Monstrous is the word that comes out of their mouths. They speak naught but a lie." [Quran 18:4-5]
The idolaters are called blasphemers because they call on other gods. No earthly punishments are prescribed for these blasphemous actions. In fact the Quran states:
"And if God had enforced HIS will, they would not have set up gods with HIM. And WE have not made thee a keeper over them, nor art thou over them a guardian. And abuse not those whom they call upon besides God, lest they, out of spite, abuse God in their ignorance. Thus unto every people have WE caused their doings to seem fair. Then unto their Lord is their return; And HE will inform them of what they used to do." [Quran 6:107-108]
This is the admonishment to the Muslims. Do not abuse those who call upon others besides God. The verse goes on building this theme to a point where the Quran says you should remember one thing, that your understanding is all relative. All people believe in something and their belief is beautified to them by their own psyche. So, you can't punish them because what you believe to be beautiful may be ugly in the sight of others who look at you from a different point of view, from a different vantage point. So, having discussed this principle, the Quran says leave it to God, He will decide in the hereafter who was right and who was wrong and He will judge accordingly, according to people's acts and beliefs.
Further, we are told that people cannot punish others for blasphemy. We are told only to not associate with such people.
"And when you see those who enter into false discourses about Our communications, withdraw from them until they enter into some other discourse." [Quran 6:68]
"And HE has already revealed to you in the Book that when you hear the Signs of God being denied and mocked at, sit not with those who indulge in such talk until they engage in some other talk; for in that case you would be like them. Surely God will assemble the hypocrite and the disbelievers in Hell, all together." [Quran 4:140]
You will note that it does not state, "when you hear the Signs of God being denied and mocked at, kill those people". The 'Islamic' States that persecute blasphemers or even apostates are quite clearly acting in opposition to Islam.