In Germany, murdering people is illegal. You have two choices: not murdering people, or leaving. ( Or get caught and convicted ). I don't think this violates any rights. You don't live by our standards, you better not live here.
A law like that would violate people's rights. People should not be forced to leave a country if they can't conform to its standards. This is their home. A country's system of government should serve the people living in the country, not the people that government wishes lived there. (Of course, if it was truly an imaginary country, leaving wouldn't be a problem.)