Oops, our bad. But it was on the books! Such was the response, essentially, of the East Baton Rouge Sheriff’s Office, after The Advocate newspaper reported on Sunday that at least 12 men had been arrested since 2011 under a sodomy law invalidated by the Supreme Court a decade ago. Most of these men were arrested after being approached by a male undercover cop at a public park and agreeing to have sex at a private residence. No money changed hands.

In 2003, the landmark Lawrence v Texas Supreme Court case declared a Texas statute prohibiting oral or anal sex – a so-called “sodomy law” — unconstitutional. Louisiana’s then-attorney general announced that a similar law in his state was not enforceable. But today the statute is still in Louisiana’s criminal code and similar laws remain on the books in at least a dozen other states. And the Baton Rouge case shows that in some pockets of the U.S., gays still have reason to be wary of police.

“To our knowledge, the Sheriff’s office was never contacted or told that the law was not enforceable or prosecutable,” the East Baton Rouge Sheriff’s office said in a statement released on Facebook. The statement also said “the deputies in the cases were acting in good faith using a statute that was still on the books of the Louisiana criminal code.” This post has since been deleted: in a new statement, the Sheriff’s Office apologized “to anyone that was unintentionally harmed or offended by the actions of our investigations,” and regretted “that the way these investigations were handled made it appear that we were targeting the gay community.” The statement added that while sodomy laws “have not been removed from the Louisiana law code, they have been deemed unenforceable and unconstitutional. The Sheriff’s Office will not use these unconstitutional sections of the law in future cases.” Baton Rouge prosecutors did not press any charges.

(LIST: Top 10 Controversial Supreme Court Cases)

Thomas D’Amico, a Baton Rouge attorney, represented one of the men arrested in the sting operations. “One of two things are going on here,” says D’Amico. “The sheriff’s office is either harassing people for their lifestyle. Or they don’t know the law. Neither is good for Baton Rouge, I can tell you.”

In addition to Louisiana, Idaho, Utah, Michigan, Virginia, North Carolina, South Carolina, Florida, Alabama, Mississippi, Kansas, Oklahoma and Texas have kept unenforceable sodomy laws. In Kansas, Oklahoma, and Texas, only sodomy among homosexuals is outlawed. (Sec 21.06 of the Texas Penal Code, for example, bans “homosexual conduct,” or “deviate sexual intercourse with another individual of the same sex.” Before the statue comes a disclaimer: “Section 21.06 was declared unconstitutional by Lawrence v. Texas”).

These laws seem to have no teeth, but critics argue they can still stigmatize homosexuality. “It opens gay people to potential harassment,” says Jim Harrington, director of the Texas Civil Rights Project. In 2008 for example, two men in Raleigh, North Carolina, were arrested under the state’s sodomy statute for engaging in consensual sex. “The law is still on the books,” the Raleigh police captain told the News & Observer newspaper. “What the D.A.’s office will do with it, I don’t know.” Charges were dropped, but the damage – unwanted media attention, a jail stay — was done. “I’ve never been so humiliated in my life,” one of the men told the News & Observer. “It’s just awful.”

(MORE: Will Sodomy Charges End Malaysia’s Opposition?)

Such arrests also put taxpayers at risk. What if one of the men arrested in the Baton Rouge case, for example, decided to sue the city? According Justin Harrison, an ACLU attorney in New Orleans, no plaintiffs have come forward thus far. “This is the type of situation where people often don’t want the increased exposure that comes along with a federal lawsuit,” Harrison says. D’Amico says the man represented in Baton Rouge wants to stay out of the spotlight. The case has cost him enough already: D’Amico estimates that between bond and lawyer’s fees, his client was out $7,500. That’s no small sum for doing nothing wrong.

In many of the states where sodomy laws still exist, the political climate simply isn’t suited for repeal. “There’s an unwillingness among conservatives to appear that they are for gay sex,” says Carlos Maza, a researcher at Equality Matters, an LGBT advocacy group. In Virginia, Republican attorney general Ken Cuccinelli, who is running for governor, has asked the Supreme Court to stay a lower court decision that declared Virginia’s sodomy law unconstitutional.

Even for progressives, says Maza, the conversation about sodomy is unwelcome. After all the strides on gay marriage, Don’t Ask Don’t Tell, and other issues, why remind people that homosexuality was once a crime in many places? Still, many gay advocates feel the conversation is worthwhile. “There’s some good news in the Louisiana case,” says Kenneth Upton, senior staff attorney at Lambda Legal, an LGBT rights organization. “The country is learning that leaving something on the books isn’t harmless. Just because laws are not enforced, and are not prosecuted, doesn’t mean that people can’t be harassed.”

MORE: Pride and Prejudice: An Interactive Timeline of the Fight for Gay Rights