Yet Mr. Sanford, a libertarian-leaning conservative, is plainly uneasy that some in his party are demanding loyalty tests to a president who does not share his small-government convictions.

“We’re at an interesting inflection point in American politics,” he said in an interview. “If somehow dissent from your own party becomes viewed as a bad thing, then we’re not really vetting and challenging ideas in the way the founding fathers intended.”

Broadening his argument, Mr. Sanford said America was meant to be “a nation of laws, not men” and that “we weren’t a cult of personality.”