It had allowed defendants to reduce criminal responsibility by claiming provocation due to an unwanted sexual advance.
In 2008, it was used as a partial defence to reduce two men's murder charges to manslaughter.
The case prompted a campaign for the controversial law to be changed.
Wayne Ruks was bludgeoned to death in a Maryborough church ground in 2008 by two men after one said he had grabbed his crotch.
After successfully using section 304 of the Criminal Code [killing on provocation] the two men charged with his murder received lesser jail terms.
One of his attackers was released after just four years of a nine-year manslaughter sentence.
Queensland Attorney-General and Minister for Justice Yvette D'Ath said: "The passing of this legislation sends an important message that discrimination is not acceptable and that we value the LBGTI community."
Wayne Ruks's mother, Joyce Kujala, said she had waited eight years for the change.
"It can't bring Wayne back but it's some small justice and it could save a lot of lives in future," she said.
Parliament in the Australian state of Queensland has voted for legislation to remove a controversial "gay panic" defence from the criminal code.