So far I've read attributions of the (very slim) majority vote to anger at being priced out of metro areas, anger at the Germans, racism, boneheadedness, not being exposed to enough immigrants(*)--everybody has a theory, and most of them consider the Swiss dead wrong.
But although my French is pretty miserable and my German non-existent I did try to read the newspapers while I was over there, and I think the commentators are too simple. I'm not going to propose reasons myself because I'm tolerably sure that the reasons vary a lot from place to place. (We sometimes forget how federal Switzerland still is, and that there are some regional disagreements shading into animosities.) I'm waiting for somebody to ask the Swiss why--and I'm rooting for them to tell the pollsters to take a long walk off a short pier. I generally root for that anyway.
(*) This was a conclusion based on noticing that the vote was more anti-further-immigration in cantons that had less immigrant fraction. Possibly it didn't occur to the writer that there was more than one interpretation of that observation.