The ruling follows years of persecution of gay Ugandans. Many Ugandans accuse gay men and women of recruiting children to a gay lifestyle, a charge activists reject as preposterous. The government was even considering a bill last year to make homosexuality punishable by death and imprison those who did not report gay friends or family members, a proposal that was quietly shelved after international outrage.
Homosexuality is already illegal in Uganda but recently gay rights groups have begun protesting their treatment.
The activists who brought the case against the magazine to court were only three of 100 Ugandans listed in the magazine in October. They said they were attacked after they were identified as gay underneath a banner headline reading "Hang them."
The magazine also published the home addresses of those it accused of being gay, and several of those featured in its pages said they were subjected to vigilante attacks.
"The court found that there was infringement of some people's confidential rights. Their rights of freedom were abused. Exposing them was unfair and by threatening them with death, their rights were arbitrarily abused," said court official Isac Muwata as he read the judgment.
The three activists and their supporters hugged each other in court after the judgment.
"I am happy that the ruling has come this way. It gives us a bit of confidence in the justice system of this country that we are also acknowledged as citizens of Uganda," said Julian Onziema, who heads up Sex Minorities Uganda Program and was one of those who filed the case.
But others were less happy.
"We are behind Rolling Stone. We advise the paper's management to appeal," said Pastor Solomon Male on the court steps outside.
Rolling Stone would appeal the ruling, said managing editor Giles Muhame.