Foreigners with no direct blood ties to Switzerland through either birth or marriage must live in the country for at least 12 years before they can apply for citizenship. (Years spent in the country between age ten and 20 count double). So it was pretty easy for these foreign born soccer players to get their citizenship.
I was born and raised in Switzerland - my dad was an immigrant/expat and chose to never get his Swiss citizenship even after living there for over 50 years.
Oh and by the way - Resident foreigners and temporary foreign workers make up about 20% of the Swiss population.