I am assuming you have read most the post in basic belief system of Islam on this site before coming here http://reconstructingthestrangers.com/category/belief-system-and-basic-concepts/ ; If not then please do take a look to make more sense of this question.
people have this misconception about Islam that how free will is possible if Allah knows every thing, so as human we are free to do any thing ( of course bounded by some physical laws) and nothing is stopping us from doing it; but the out come or final result is control by Allah and is known to him and he can change that if he want to like Prophet Ibrahim AS was thrown into fire but Allah ask the fire to not hurt him and he came out of it with no harm.
This also dictates that on day of judgement Muslims will be judge based on their intention and effort and sacrifice not on outcome since you don’t control it, that is why there is another verse of Quran which is put forward by Muslim in their defense “that there is no compulsion is Islam” , because as a Muslim one is not in control of changing a belief of any one (let alone be by force) since Allah is is in control of out come but we are prescribed to say what is right and guide people to right path and we will be judge on it; this is contrary to worldly life were some one invested and put his day and night to set up a company but in the end he was not able to make it to break even, people will consider him a failure but in Allah eye people will be judged on their effort and intention
So back to question of punishment of leaving Islam, and as far as my learning and reading goes it is punishable by death, but it only applied if country is set forth on pure Islamic basis ( which is not the case with any country in modern era as most of them are secular or have kingship like Saudi Arabia), so why leaving Islam is considered punishable for a real Islamic Country ( off-course it has to be proven and state has the right to exercise it) because for an Islamic state to exist it is the ideology based on Quran and Sunnah not any race,color,language and creed and if some body tries to harm it state has to protect it else there is a possibility of it being disintegrated; in order to stop this from happening this clause is added or practiced in Islam. Now before you try to criticize Islam for it let me ask you a simple question what is the punishment of treason in any country and why, is it not punishable by death in most of the countries, because state has to protect it self .
Similarly if a country is based of Islamic principals and not just part of it or has a name which has Islam in it than having such a rule is applicable but as i mentioned above none of the Muslim countries countries are truly following Islam and having this rule might cause more harm to Islam and them selves than putting it away
Hope every one finds Islam logical and according to needs and nature of a human being because I truly believe it is the right path