According to the Islamic viewpoint Is the government entitled to force women to observe Hijab in the society? knowing that "there is no compulsion in religion" why Hijab is being enforced in some Islamic countries?
I don't know if there is a law in Islam that allows enforcement of women (an men) to be covered at legal proportions.
I know there is a hadith that talks about muslim women at the end of time that will dress while being undressed. The prophet then sais to curse them, since they are cursed by god. (so it seems like he didn't state a physical/legal punishment for that, but rather a social one). This is the point where the answer of @Ali786 becomes relevant: if people reject them, the society perceives them as disturbing cursed elements, chances of the behavior getting expanded are greatly reduced (as long as people will reject them)
Not long ago it was against law in Europe/US to be dressed shorter than a certain Cm count from the knees. There were laws for molestation, and it was clearly visible that the society didn't want undressed people. Their solutions were maybe too radical, and their beliefs too week, since Edward Bernays made nudity fashionable through Marilyn Monroe and some other stars, and people didn't know why they disliked nudity, so decency fastly disappeared from that part of the world (also thanks to the main stream media).
So to answer you even if I don't know about legal rules, the society should be the one who chooses laws that rule it, in a society that has a majority of muslims, the law should democratically, fairly, by revolution etc... inevitably fall into muslim rules.
The good point in islam is that you cannot add rules to override islamic rules or even complete them : if something has no clear evidence of being ruled by islam, you cannot say that islam didn't think about that point and invent something new :
ex: women getting more and more naked because of TV and media influence, so => we should stop by by adding a law that punished women without hijab
We know the book is from God, and God knows the future, so if something is not stated, it's not because God didn't know, but because the answer is elsewhere.
To get back to the Hijab subject, if the prophet didn't state a punishment for not wearing hijab, he stated that people should curse these women, which is a drastically better and more durable solution. And since we are here only for the exam, and each person will get rewarded for what he've done and the consequences of his acts (even thousands of years after his death), each person should follow the rules to be able to justify himself the day he will face God.
p.s: cursing is a behavior that is quite incompatible with islam, there is here a strong subtility that you cannot understand from where you seem to be. Anyway, keep in mind that cursing a muslim is always a kind cursing to remind him he is in a wrong way, it's not just to insult and feel better.
I think you are confusing "no compulsion in religion" with "no compulsion within religion". Read the rest of the ayah and it becomes clearer what it means inshAllah.
As for governments enforcing this, it'll be interesting to read some of the views of the more learned folks who visit this site. It also may be worth getting in touch with some of the scholars of the respective countries who have some say in what rules the state applies.
Allah says: “Let there be no compulsion in religion. Truth has been made clear from error. Whoever rejects false worship and believes in Allah has grasped the most trustworthy handhold that never breaks. And Allah hears and knows all things.” [Sûrah al-Baqarah: 256]
This ayath stating about forcing one to convert his religion and follow Islamic rules.
But here the rule is forced by government see the answer of brother @Zied Hamdi. in whatever country or region you live you have to follow there rules. and why this hijab is forced by some Islamic countries have the following reasons. And They are not forcing to live with respect to there religion. and no religion says that they should not wear hijab so they are not forced to leave there religion.
And Hijab will give protection to women's. The philosophy is if you don't see something you wouldn't think good or bad about that and you will be safe and the women will also be safe.
No one will do the things directly.
First you see something, Then you think about that thing may be eatables or electronics etc you think about what is it how it is what benefit will I get when I take this etc, Then you decide to purchase it, and finally you purchase it.
same applies to women if the women is in hijab then nobody will see it and nothing will happen.
Today you are telling not to wear hijab tomorrow you will say allow to wear western culture dresses It will not be allowed.
See the links this might be helpful.