By Scott Malone

BOSTON (Reuters) - Three federal appeals court judges showed skepticism on Tuesday on how a 2014 New Hampshire law banning voters from taking selfies with their ballots on election day does not violate the U.S. right to free speech.

The judges repeatedly asked a New Hampshire official to explain how the law could prevent a replay of scandals that rocked many U.S. states in the late 19th century, when politicians paid for votes, in cash or alcohol.

"It's well known that in the late 1800s, buying votes was a huge problem," Stephen LaBonte, the state's associate attorney general, told a three-judge panel of the First Circuit of the U.S. Court of Appeals in Boston.

"What year is it now?" Judge Sandra Lynch shot back. "In the late 1800s there was a huge problem that obviously didn't involve ballot-selfies, which did not exist at the time."

LaBonte explained the state's position that the growing trend of voters taking pictures with their filled-in ballots and posting them on social media sites, including Facebook and Twitter, could lead to voters being paid or coerced to change their votes.

"You have no evidence of that. None," Lynch said.

Opponents of the ban contend that it violates the free-speech protections of the First Amendment of the U.S. Constitution. A New Hampshire voter sued in October 2014 after posting online a photo of his ballot, on which he filled in the name of his dog as a sign of displeasure over his choices in the 2014 Republican primary for the U.S. Senate.

The U.S District Court in New Hampshire agreed, pronouncing the law unconstitutional in August 2015. The state appealed the following month, setting the stage for Tuesday's arguments

Opponents of the measure contend ballot-box selfies are a form of political speech familiar to first-time voters, akin to the photos they post of themselves on vacation, at concerts or with friends.

Judge Ojetta Rogeriee Thompson noted that Rhode Island last month legalized the practice, reasoning that it helps to excite young voters.

Attorney Gilles Bissonnette of the American Civil Liberties Union, who spoke on behalf of the plaintiffs, noted that the three plaintiffs who brought the initial lawsuit challenging the law had been investigated for politically motivated posts.

"The three plaintiffs in this case were carrying out a form of political expression," Bissonnette said. "None of them are charged with vote buying."

(Reporting by Scott Malone; Editing by Steve Orlofsky and Bill Rigby)