But on at least one issue, Perry gets it right: immigration. He’s justifiably proud of signing a Texas law that grants in-state college tuition to the children of undocumented immigrants attending state schools. As the governor argued recently in Florida: “If you say that we should not educate children who have come into our state for no other reason than they’ve been brought there by no fault of their own, I don’t think you have a heart. We need to be educating these children because (otherwise) they will become a drag on our society.”

Perry’s sane words, however, drew catcalls from the crowd and led to his stunning defeat by Herman Cain in a straw poll of conservative activists the next day. Mitt Romney immediately saw an opening and started beating the drum of denial. “I think if you’re opposed to illegal immigration,” he declared, “it doesn’t mean you don’t have a heart; it means you have a heart and a brain.”

It’s Romney who’s not using his brain. Here’s a guy who promotes himself as an economic expert, and yet he panders to the anti-immigration hard-liners by refusing to admit an obvious truth: The children of those undocumented aliens are not going anywhere. It’s a no-brainer — for Texas and the rest of us — to invest in their education and help them become taxpaying, job-creating citizens.

When the Texas law passed 10 years ago, it commanded virtually unanimous support from both parties. About a dozen states have enacted similar programs since then, and even conservative businessmen like the idea. Listen to Charles C. Foster of the Greater Houston Partnership, who told The New York Times: “The future of the business community is having a well-educated workforce. We realize the trajectory of Texas is no longer going to be an industrial, steel-age state. It’s going to be based on brainpower.”

Of course, Romney knows this. He also knows how unfair his attacks on Perry really are, because he’s been victimized by a similar demand for ideological rigidity. As governor of Massachusetts, Romney signed a health care bill that made total sense: require everyone to buy insurance (or pay a penalty). Without an individual mandate, many people, especially the young and healthy, will roll the dice and decline to purchase a policy. But when they need care, they go to expensive facilities such as emergency rooms and stick taxpayers with the bill.

Romney still defends the law but maintains that President Obama’s plan, which follows the same basic principles, should be repealed. For this business genius to argue that the economic laws that apply in Boston are suddenly suspended in Baltimore and Birmingham defies logic. But that’s what the party base demands.

The attacks on Perry’s immigration views and Romney’s health care plan are really part of a much larger trend: purging from Republican ranks anyone who strays from party orthodoxy and even hints that Democrats might have, well, a brain. Here’s a partial list of GOP heretics recently exiled for the sin of sensibility:

• Former Sen. Robert Bennett of Utah was denied renomination for a fourth term by his party’s convention.

• Former Sen. Arlen Specter of Pennsylvania was driven from the party by the threat of a primary challenge from the right.

• Former Rep. Mike Castle of Delaware was defeated in a Senate primary by a far more conservative rival.

• Former Gov. Charlie Crist of Florida ran (and lost) as an independent for the Senate after trailing badly in the GOP primary.

• Former Sen. Lincoln Chafee of Rhode Island left the party and won the governorship as an independent.

• Sen. Lisa Murkowski of Alaska lost the primary to a more conservative challenger but then won the general election as a write-in candidate.

• Sen. John McCain survived a primary fight in Arizona, but only by moving sharply to the right.