ORANGE CITY, Iowa — A year ago, Evan Wielenga, 40, believed — as does his congressman, Steve King — that undocumented immigrants should all be deported. They broke the law to enter the country. They spoke little English. They strained schools and public services.

But as talk of a border wall and a Muslim ban overtook the presidential campaign, Mr. Wielenga, the agronomy manager of a farmers’ co-op here in northwestern Iowa, had a change of heart.

He heard dairy farmers say they couldn’t get their cows milked without immigrants. “You can put an ad in the paper and you won’t get two white guys to apply,” said Mr. Wielenga, who grew up on a dairy farm himself.

He heard of the ruinous damage an immigration raid had done to families. “Some of these kids were born in the U.S.,” he said. “These families had lived here 10 years, and all of a sudden, Dad’s gone, Mom’s gone. When you think of it from that perspective, what’s the lesser of two evils?”