It was a robbery. The attackers might have pretended to be gay to get Shepard in the car (and one of them might have been a former sex partner), but it was a robbery.
The attackers did try the gay panic defense in court and a girlfriend of one of them lied to support that, but she also later admitted she lied about it. But the goal was obviously a reduced sentence (remember it wouldn't have been a hate crime).
Shepard did have a shitty life, at least partially if not entirely because he was gay -- he was severely depressed, involved in drugs and possibly a drug dealer, HIV positive, and had been raped at least once -- but he wasn't killed directly because he was gay.