Back in 2003, the Supreme Court ruled in Lawrence v. Texas that it's unconstitutional to ban sodomy. At the time, this was considered a huge gay rights victory, even though there weren't many states at that point which had those laws. It rendered unenforceable one more facet of anti-gay discrimination and it reversed the bad law that was made by the 1986 decision Bowers v. Hardwick. In that case, the Supreme Court upheld the constitutionality of a sodomy law as used in a case where police arrested a gay couple for sodomy in the privacy of their own home.
In overruling the case, Justice Kennedy remarked forcefully that "Bowers was not correct when it was decided, and it is not correct today."
Sodomy laws are yet another way to infringe on the personal liberties of LGBT Americans. For the longest time, our right to free association did not exist. We couldn't even congregate in bars if we wanted. We were at risk of sting operations and bar raids, among other things. The goal was ostensibly to police "morals" in society, but the state has always served to terrorize gays, to keep us in the closet and out of public life. In the 70s, there was even the "Save Our Children" campaign to keep gays from teaching in schools. That's still considered a valid idea to some politicians to this day. So it is not surprising, with that in mind, that some states are still trying to prolong state sponsored terrorism against gays: