ZURICH—Right-wing parties made big gains in Switzerland’s parliamentary elections Sunday, after a campaign in which concerns about immigration and asylum-seekers took center stage.

The populist Swiss People’s Party, or SVP, strengthened its position as the country’s largest party, a move that could shift Switzerland’s government to the right and affect its relations with the neighboring European Union.

In...