THE horrifying murder two years ago of Matthew Shepard – a gay Wyoming college student who was beaten, tied to a rail fence and left to die – had something that made it more than just a true-crime story.

It was the cavalier attitude of his two killers – who admitted to cops that they attacked Shepard because he was gay – that turned Shepard’s death into a national cause.

Within months of the murder, no less than three TV networks announced they had movies about the shocking crime in the works.

The first – “Anatomy of a Hate Crime” – will air next Wednesday on the most unlikely of TV channels, MTV.

The music video network was in hot water all last year for promoting the music of rap bad-boy Eminem – who is accused of using anti-gay lyrics in his songs. But executives say Shepard’s was a story they couldn’t ignore.

“There have been lots of [other] stories of this magnitude, and we wrestled with that, but the imagery of this boy on the fence was so powerful,” says Brian Graydon, MTV’s executive vice president of programming.

“It’s like the imagery of James Byrd,” says Graydon, referring to the black man who was dragged to his death by white supremacists in Texas.

“It’s a piece of imagery you just can’t shake.”

Shepard’s story has attracted a who’s who list of Hollywood producers.

“Anatomy” was produced by Lawrence Bender, producer of “Good Will Hunting” and “Pulp Fiction,” and Kevin Brown, the producer behind the hit TV series “Roswell.”

An NBC movie, “The Matthew Shepard Story” – which has with the endorsement of Matthew’s mother, Judy Shepard – is being produced by actress Goldie Hawn’s company.

It is tentatively set to air next season.

Meanwhile, HBO has a movie in the works called “The Laramie Project,” based on an off-Broadway play.

The murder has become a rallying cry among gays and anti-hate crime proponents virtually since the day it happened in October 1998.

The MTV movie, in fact, is narrated by the actor playing Shepard – a la “Sunset Boulevard.”

In the film, Shepard wonders what drives people like his killers to such fury.

“It’s also important that this movie is airing on MTV because Shepard’s killers are certainly of the MTV generation,” says Scott Seomin, spokesman for the Gay and Lesbian Alliance Against Defamation (GLAAD).

“This could easily have been a Sunday-night ‘Hallmark Hall of Fame’ movie on network TV, but it wouldn’t have been as powerful – and wouldn’t have hit the target audience of younger viewers,” Seomin says.

So why the three-year delay between Shepard’s death and bringing his story to the small screen?

“It wasn’t really a rough road – we were just very self-conscious about trying to do Matthew’s story justice and trying to do it the right way,” says Graydon. “The power of the media is such that the retelling of a story sometimes becomes the story.

“For me, it was important to be cognizant of the fact that it takes time – and we just wanted it to be right.”