(CNN) A lot has changed for gay Americans in the 20 years since Matthew Shepard, a student at the University of Wyoming, was beaten, tortured, tied to a fence and left for dead by two men he had met at a bar.
In October 1998, when Shepard was killed, only Minnesota and the District of Columbia had laws that covered hate crimes against LGBTQ people. Today, 18 states have hate-crime laws that address sexual orientation or gender identity, and another 12 states address hate crimes based on sexual orientation.
Same-sex marriage is legal nationwide. Polls show Americans are increasingly accepting in their views of LGBTQ people.
And yet in some ways, nothing has changed.
Fifteen states still don't have laws addressing crimes motivated by a victim's actual or perceived sexual orientation or gender identity. And five states -- Arkansas, Georgia, Indiana, South Carolina and Wyoming -- don't have hate-crime laws at all.
"Frankly, I don't understand why every state in the country and every country in the world doesn't have hate-crime laws," said Lesléa Newman, an author and LGBTQ activist who was the keynote speaker for Gay Awareness Week at the University of Wyoming the week that Shepard died. "I have heard the arguments — mostly backed up by quotes from the Bible taken out of context — that the LGBTQ community doesn't deserve to be protected or even to exist.
"I did hear, 20 years ago, people say things like, 'Even if Matthew Shepard was gay, he didn't deserve to be killed so brutally.' It shouldn't take such a violent, hateful act for people to come to that conclusion. We are all human beings, and we all deserve to live in peace, without fear for our lives."
Thanks in part to his parents, Matthew Shepard has had a potent legacy. Judy and Dennis Shepard founded a foundation in their son's name and have traveled the country speaking out for LGBTQ rights.
Their efforts finally bore fruit in 2009 when, after years of failed attempts, the Matthew Shepard and James Byrd, Jr. Hate Crimes Prevention Act -- named also for a black man who was killed by three white supremacists in Jasper, Texas -- made it through Congress and was signed into law by President Obama.
The act expanded a 1969 hate-crime law to include crimes motivated by a victim's actual or perceived gender, disability, sexual orientation or gender identity.
But LGBTQ advocates say the law only applies in cases where the federal government has jurisdiction, and that state legislatures need to act as well.
Many lawmakers, however, have balked at extending special protections for LGBTQ people while arguing there's no evidence that hate-crime laws deter violence.
"Some legislators view protections for LGBT people to be counter to their belief that being LGBT is wrong," said Sarah Warbelow, legal director for the Human Right Campaign. "Sometimes states don't see this as a critical issue. They aren't paying attention."
LGBTQ advocates are pushing for hate-crime prevention laws in those states that don't have them. What complicates things, Warbelow says, is that many of those states also lack laws that prohibit housing and employment discrimination against LGBTQ residents.
"All those pieces are critical in creating an environment in which LGBT people can be free to live their lives," she said.
"If you want to add another layer to that," said Sara Grossman, spokeswoman for the Matthew Shepard Foundation, "there's almost 30 states where you can be fired simply for being gay."
Shepard died October 12, 1998, at a hospital in Colorado -- six days after his attackers pistol-whipped him, fractured his skull and left him tied to a fence to die. People across Wyoming and around the world were horrified.
And yet Wyoming, home to an estimated 15,000 LGBT residents, remains one of the five US states with no hate crime laws.
A study by the Williams Institute at UCLA's School of Law found that only 6% of Wyoming's adult population is covered by local laws that prohibit discrimination based on sexual orientation and gender identity in areas such as employment and housing.
But while the state has refused to pass protective measures for LGBTQ residents, some Wyoming cities have passed their own.
Casper, the state's second-largest city, just passed an anti-discrimination bill in February.
"I think that whatever we can do in politics to enhance the quality of life ... and the equality of people, we should do it," said Councilman Dallas Laird, who backed the resolution. "Whatever it takes."
Laird, who was deeply affected by Shepard's death, said he received a lot of pushback from religious groups about the resolution.
"I think they forgot about one of Jesus's statements, which the way I interpret is, God does not play favorites," he told CNN.
"My vote for that basically was a statement against persecuting people for who they are, and I'd do it all over again."
FBI statistics show the number of reported hate crimes against perceived or actual LGBTQ people in the US have stayed about the same or declined slightly since Shepard's death.
But a Department of Justice report last year found that a majority of hate crime incidents are not reported to police. And there are signs that violence against LGBTQ people has spiked recently.
Last year, 52 LGBTQ people in the US were killed as a result of hate violence -- an 86% increase from 2016 -- according to a report by the National Coalition of Anti-Violence Programs. The group said it was the highest number of anti-LGBTQ homicides they had recorded in their 20 years of tracking these reports.
Women and minority communities are under attack too, said Grossman of the Matthew Shepard Foundation.
"We see that happening because people feel emboldened not only to say the things that are in their hearts, but they're also acting on them," she said. "Everybody seems to be under attack unless you're white, straight and male."
The Matthew Shepard Foundation received some funding from the federal government under President Obama but has received none since President Trump took office, relying instead on corporate sponsors and individual donations, Grossman said.
The White House did not respond to a request for comment.
Still, advocates remain hopeful that over the long run, anti-LGBTQ violence and discrimination will subside as society evolves.
There's been a dramatic shift in people's attitudes towards LGBTQ people in the 20 years since Shepard's death, Warbelow said.
"That's driven by more Americans willing to come out to family and friends and be open about who they are," she said.
Grossman, too, is optimistic that things will get better.
"Maybe it's because I'm an idealist," she said. "The gains that we made under President Obama and the way that country seemed to start moving in the same direction gave me hope."
And it all starts with the young generation, she said -- people roughly the age Shepard was when he died.
"They're going to get all their friends registered to vote, they're going to show up and they will keep doing that until the life they felt secure in comes back."
Correction: This story has been updated to remove the phrase "LGBTQ lifesyles." It is CNN's editorial practice to not use the word lifestyle when referring to LGBTQ people, as lifestyle has no association with sexual orientation or gender identity.