This month’s midterm elections resulted in the election of more openly lesbian, gay, bisexual and transgender people than ever before. But for Cross Coburn, who served as an openly gay councilman in a small Texas city, it was a day of bitter defeat.

He was ousted in a recall election on Nov. 6, nine months after he was told that City Hall had received an anonymous package of nude photos that Mr. Coburn had sent in private messages on the dating app Grindr. Those photos were later sent to the local news media, after which supporters of a petition to remove him questioned whether he fit the “moral standards” of the city.

“I regret that it got out, but I will never regret being human,” said Mr. Coburn, who served about one year of a two-year term. “I do not believe that me having consensual conversations with another adult has any merit to how I can perform my duties.”

Mr. Coburn, 19, ran uncontested for the nonpartisan position last year and supported progressive policies in Groves, Tex., a conservative community of about 16,000 people near the Louisiana border.