Wyoming has never been easy to pigeonhole when it comes to gay rights. Republicans dominate state and local politics, and support for gun rights, low taxes and small government runs as deep as groundwater. But so does a cowboy libertarian streak, residents say, rooted in ranches, homesteads and a notion of “You live your life, and I’ll live mine.”

Wyoming repealed its sodomy law in 1977, a generation before the Supreme Court declared such laws unconstitutional. Several times in recent years, Republican lawmakers have rejected efforts by social conservatives to ban the recognition of same-sex marriages from other states or to add “defense of marriage” amendments to the State Constitution.

Eight years ago, an openly gay 27-year-old named Guy Padgett served a term as the mayor of Casper. People who would never support same-sex marriage nonetheless gave him a fair shake, he said. In a state where many voters are on a first-name basis with the governor and see their elected officials in church or cafes, it is harder to vilify people you disagree with, residents said.

“I’ve never felt uncomfortable or threatened or out of place,” said Mr. Padgett, a Democrat who now lives in Denver. “There is a strong streak in the Republican Party in Wyoming to let people live their lives — that sort of respect for space.”

In some more conservative quarters, the Supreme Court’s decision to strike down the federal Defense of Marriage Act felt like an attack on that let-live ethos. Mark Baker, a Republican state representative from Rock Springs, said Wyoming was comfortable with marriage as it stood in the state. He said he had considered the arguments for allowing everyone to marry — his half sister is a lesbian, he said — but called same-sex marriage the first step on a “slippery slope.”

“Once you go down that path, where do you stop?” Mr. Baker said. “Is it going to be legal for four or five people to marry because they love one another?”