The horrific killing of Matthew Shepard in 1998 is widely seen as one of the worst anti-gay hate crimes in American history. Matthew was beaten by two assailants, Aaron McKinney and Russell Henderson. They pistol whipped him with a gun then tied him to a fence in freezing conditions and set fire to him before leaving him to die.

The attack became a cause célèbre: it precipitated a national backlash against hyper-macho culture and tacit tolerance of homophobia. As a result of Matthew’s death, many good things have happened for the gay community. The play The Laramie Project has toured the US and many other countries, telling Matthew’s story and encouraging campaigns against bigotry. Politicians and celebrities pledged support and funding to combat anti-gay hate crime. The Shepard family have become campaigners for gay rights. Judy and Dennis Shepard run the Matthew Shepard Foundation, which funds educational programmes and an online community for teens to discuss sexual orientation and gender issues. There have been numerous documentaries, dramas, books and events based on the story.

The men responsible for his death were convicted of first-degree murder and given two life sentences. They were not charged with a hate crime, as that wasn’t possible under Wyoming’s criminal law. But after lengthy wrangling in congress, President Obama finally signed the Matthew Shepard Act in 2009, a law which defined certain attacks motivated by victim identity as hate crimes.

But the Matthew Shepard story is not yet finished. A new twist came last year with the publication of another book, this one by investigative journalist Stephen Jimenez, who has spent 13 years interviewing more than 100 people with a connection to the case. His conclusion, outlined in The Book of Matt: Hidden Truths about the Murder of Matthew Shepard, is that the grotesque murder was not a hate crime, but could instead be blamed on crystal meth, a drug that was flooding Denver and the surrounding area at the time of Matthew’s death. This new theory has, understandably, caused a lot of anger.

Jimenez has faced a barrage of criticism since the publication of his book and has had readings to promote the book boycotted. Jimenez claims, however, that many of his critics have not actually read it. The Advocate, America’s leading LGBT magazine, published a piece last year entitled: “Why I’m Not Reading the ‘Trutherism’ About Matt Shepard”. Jimenez has been accused of being a revisionist, a criticism usually reserved for extreme rightwing ideologues that deny the Holocaust, and labelled a homophobe.

“People object to the idea of the book, rather than what is in the book,” says Jimenez. “The anger directed at me has been pretty extreme.”

Grade-A student: Matthew Shepard was just 5ft 2in and his slight frame gave him an air of vulnerability. Photograph: AP

Jimenez had no intention of causing such controversy. He’s an award-winning writer and TV producer, and visited Laramie shortly after the murder to gather material for a screenplay about the case. When he started he was convinced that Matthew died at the hands of homophobes, but he soon discovered that Matthew’s tragedy began long before the night he was killed.

Jimenez found that Matthew was addicted to and dealing crystal meth and had dabbled in heroin. He also took significant sexual risks and was being pimped alongside Aaron McKinney, one of his killers, with whom he’d had occasional sexual encounters. He was HIV positive at the time of his death.

“This does not make the perfect poster boy for the gay-rights movement,” says Jimenez. “Which is a big part of the reason my book has been so trashed.”

Matthew’s drug abuse, and the fact that he knew one of his killers prior to the attack, was never explored in court. Neither was the rumour that the killers knew that he had access to a shipment of crystal meth with a street value of $10,000 which they wanted to steal.

Matthew was born into an affluent family and had attended state school in Casper, Wyoming. The 21-year-old political science major at Laramie University stood only 5ft 2in, and his blond hair, braces and slight frame gave him an air of vulnerability and innocence. In his junior year of high school, Matthew moved with his family to Saudi Arabia. There were no American high schools in Saudi at the time, so he was sent to the American School in Switzerland. By the time he enrolled at Laramie he spoke three languages and had aspirations to be a human-rights advocate. Somewhere along the line, however, Matthew fell from being a grade-A student to a drug-addicted prostitute who diced with danger. He suffered periods of depression, possibly as a result of being gang raped a few years earlier while on holiday in Morocco. But this is not the Matthew Shepard who became a celebrated figure for the gay-rights movement in America.

Laramie is considered the most liberal town in Wyoming. It sits in a flat, treeless sweep of high plains. With the ranching industry in decline, employment here is dominated by the University of Wyoming. It has a quaint western charm: tree-lined streets, beautiful parks, and a renovated historic downtown at the edge of the railway yard with small shops and restaurants. It is surrounded by rolling prairie, ranches, the Snowy Mountain range and vast, wide-open spaces. But the town also has a number of mobile home parks at the edges, some more rundown than others.

On the evening of 6 October 1998, Matthew went to the Fireside bar, a local hangout that was purportedly gay-friendly. It was karaoke night, and locals rubbed shoulders with workers calling in for a swift drink on their way home. Shortly afterwards Russell Henderson and Aaron McKinney arrived. The three men chatted briefly before leaving the bar and getting in a truck belonging to McKinney’s father.

In the truck Matthew was robbed of his keys, wallet and shoes and beaten repeatedly by one or both of the men. He was then taken from the truck, pistol whipped up to 18 times on the head, and kicked between the legs. Matthew was tied to a fence, set on fire, and left unconscious.

Fifteen hours after the attack, student Aaron Kreifels was out riding his bike when he discovered Matthew tied to the fence, barely alive. He initially mistook him for a scarecrow. Matthew’s face was covered in blood, aside from tear tracks on each side of his cheeks.

Judgment day: Russell Henderson, 21, and Aaron McKinney, 22. Photograph: Ed Andrieski/AP

The first officer at the scene was Reggie Fluty. “The only thing I could see was partially somebody’s feet and I got out of my vehicle and raced over,” said Fluty, her short blonde hair, fringe, and wire-rimmed glasses making her appear more social worker than police officer. “I seen what appeared to be to a young man, 13, 14 years old, because he was so tiny, laying on his back, and he was tied to the bottom end of a pole. I did the best I could…”

After leaving Matthew tied to the fence, McKinney and Henderson headed for Matthew’s home, but on the way encountered two young Hispanic men, Emiliano Morales and Jeremy Herrera, slashing tyres for fun. The men got into a fight, resulting in McKinney cracking open Morales’s head with the same gun he had used on Matthew. Police officer Flint Waters arrived, grabbed Henderson (he and McKinney had run in different directions), and found the truck, the gun, Matthew’s shoes and credit card.

I spoke to Waters, who has since retired from the police, having seen him praise The Book of Matt on social media. “I believe to this day that McKinney and Henderson were trying to find Matthew’s house so they could steal his drugs. It was fairly well known in the Laramie community that McKinney wouldn’t be one that was striking out of a sense of homophobia. Some of the officers I worked with had caught him in a sexual act with another man, so it didn’t fit – none of that made any sense.”

But when Matthew’s friends Walt Boulden and Alex Trout heard of the attack they rushed to the hospital. They contacted the Associated Press and a number of local gay organisations that same day. Boulden, a 46-year-old college instructor who says he was the last person to talk to Matthew before he met McKinney and Henderson, linked the attack to Wyoming legislature’s failure to pass a hate-crimes bill. Boulden later said the assault was identified as a hate crime by a policeman.

Stephen Jimenez is an award-winning journalist and gay man. So why has he put such time and effort into attempting to prove that Matthew’s murder was not a hate crime, especially as it has seen him accused of being an ally to the rightwing Christian fundamentalists who deny the reality of homophobia?

“The view was that homophobic rednecks walked into a bar and saw an obviously gay man with money and targeted him and beat him to death for that reason,” says Jimenez. “But that isn’t what happened. Nothing in this book takes away from the iniquity and brutality of the crime or the culpability of his murderers, but we owe Matthew and other young men like him the truth.

“Aaron and Matthew had a friendship. They’d been involved sexually, they bought and sold drugs from each other. That complicates the original story of two strangers walking into a bar and targeting Matthew – someone they did not know – because he was gay.”

Although McKinney has never acknowledged that he knew Matthew, Jimenez found a dozen sources that had seen them together. One is Kathleen Johnson, the former owner of Laramie antiques store Granny’s Attic, who knew Henderson, McKinney and Matthew.

The young, unemployed men had not had easy lives. Henderson’s mother was a chronic alcoholic who had been repeatedly beaten by his father. McKinney had spent much of his childhood alone, left by his mother with his grandparents, who locked him in the basement to keep him out of trouble. “Russell Henderson used to hang around with gay people,” Johnson told me. “Laramie had a big gay population. I knew what people’s sexual orientation was because my best friend’s son was gay. I saw them hanging around with Russell.”

The police did not investigate the killers’ relationship to the gay community.

Five days after the attack, on 12 October, Matthew died. On 14 October a celebrity vigil was held on the steps of the US Capitol, attended by the likes of Ted Kennedy and Ellen DeGeneres. Elton John sent flowers to Matt’s funeral, Barbra Streisand telephoned the Albany county sheriff’s office to demand quick action on the case, and Madonna called an assistant to university president Philip Dubois to complain about what had happened. The day Matthew died, President Clinton told journalists at the White House: “In our shock and grief one thing must remain clear: hate and prejudice are not American values.”

Dark side: anti-gay protestors at Matthew’s funeral. Photograph: Doug Collier/AFP/Getty Images

The funeral was attended by more than 1,000 mourners – and picketed by the Westboro Baptist Church, led by Fred Phelps, a defrocked minister and founder of GodHatesFags.com. To counter the protest, Matthew’s friends dressed as angels.

JoAnn Wypijewski, an author and former senior editor at the Nation, was one of the many journalists who came to Laramie after the news of Matthew’s attack. She was there for Harper’s Magazine and was the only journalist to suggest early on that methamphetamine may have played a role in Matthew’s death. “The case was used to highlight the fact of violence against gay people,” Wypijewski told me. “Hate-crime legislation under Clinton included provisions for race and enhanced penalties for crimes against women – these were used as sweeteners [to those on the Left]. They were like the identity politics of criminal law. This is what gave some other groups the idea that hate-crime legislation was a good thing.”

Wypijewski thinks the reason some sections of the gay community are so angry about the Jimenez book is obvious: “Jimenez has taken away their angel, and there is the reflexive sense that as a community its suffering was being at last recognised. The people shaping the news require a very simple story – they have to be angels and villains.”

John Stoltenberg is a gay-rights activist who lived with the feminist writer Andrea Dworkin until her death in 2005. He’s a long-time supporter of The Laramie Project, but has also blogged positively about The Book of Matt. “Keeping Matthew as the poster boy of gay-hate crime and ignoring the full tragedy of his story has been the agenda of many gay-movement leaders,” he says. “Ignoring the tragedies of Matthew’s life prior to his murder will do nothing to help other young men in our community who are sold for sex, ravaged by drugs, and generally exploited. They will remain invisible and lost.”

Ted Henson is a former lover and long-term friend of Matthew’s. The pair originally met when Matt was growing up in Saudi Arabia. Henson told me he believes that The Book of Matt is “nothing more than the truth” and that he was “never certain” that the murder was an anti-gay hate crime. “I don’t know why there is so much hostility towards Steve,” he told me. “Matt would not have wanted to be seen as a martyr, but would have wanted the truth to come out.”

Other Laramie residents believe there is another form of prejudice at work in the way Matthew’s story has been told. One that concerns the oft-repeated notion that Wyoming is full of gay-hating bigots. Ray Hageman reported on the case for Wyoming radio in 1998 and was always sceptical of the media construction of the story. “National media couldn’t resist a narrative that fits with its preconceived notions about people in rural western states,” Hageman told me. “Y’know, us simple folks with the piece of straw hanging from our mouths, spitting tobacco and shooting pop cans from the front porch. The folks in Laramie just had to take it, because a fellow who happened to be gay was murdered in their town.”

The Matthew Shepard Foundation stands firm about the murder being fuelled by homophobic hatred. I asked for a reaction regarding the book, but was sent a pre-prepared statement by executive director Jason Marsden, who was a friend of Matthew’s. “We do not respond to innuendo, rumour or conspiracy theories,” reads the statement first issued when The Book of Matt was published. “Instead we remain committed to honouring Matthew’s memory and refuse to be intimidated by those who seek to tarnish it. We owe that to the tens of thousands of donors, activists, volunteers and allies to the cause of equality who have made our work possible.”

Coming to light: a vigil held in New York for Matthew Shepard on 19 October 1998, two weeks after he was murdered. Photograph: Evan Agostini/Getty Images Photograph: Evan Agostini/Getty Images

On 16 September the Casper Star Tribune, the local paper in Matthew’s home town, published an editorial claiming that an award Jimenez had recently received for his book “deserves rejection”, saying: “From the beginning there have been those who want to ignore the sadistic homophobic motives of Shepard’s attackers and instead insist the matter was a drug deal gone bad.”

The debate will no doubt rage on. Matthew Shepard’s murder will always be, for some, a symbol of the hatred many lesbians and gay men face in the US and beyond. The town of Laramie can take some comfort from reacting with such dignity and humanity in the aftermath and lending its name to The Laramie Project, which has changed hearts and minds. But the mystery remains – not so much why Matthew died, but why the gay community, after almost five decades of campaigning for equal rights, relies so fundamentally on the image of the perfect martyr to represent the cause.