It doesn't come as a surprise. Switzerland has a history of xenophobia, even though it has one of the most generous policies for political refugees in the world. About 22% of its 8.1 million legally registered population consists of foreigners, not including the thousands of UN functionaries living in and around Geneva.
So – why this rather negative reputation about 'fear of immigrants'? - The right wing of this center-right governed country makes a lot of anti-foreigner noise. They have the majority in Parliament and they have a lot of money – the financial sector and big industry. Largely thanks to their propaganda, but as an apparent surprise to the Federal Government, the Swiss have voted in a referendum in February 2014 to limit the number of foreigners that are allowed to enter Switzerland. This completely contradicts the rules of the EU – of which Switzerland is not a member, but it has a large number of bilateral agreements with EU member countries, almost equaling EU membership. As a consequence, Helvetia has to adhere to most of the EU rules. And the free (unlimited) movement of people across EU borders is one of them.