The incident occurred in the pedestrian precinct at Lockhart Road, Causeway Bay, on May 15 last year during an event to mark International Day Against Homophobia.
The protesters had been dancing for five minutes to get their anti-discrimination message across when they were stopped by police.
Officers said the organizers did not have a license under the Places of Public Entertainment Ordinance.
Under the law, any person who wants to organize any entertainment in a public space should apply for a license six weeks in advance.
"T" filed a judicial review over the protesters’ right to freedom of expression, claiming the entertainment license only regulates enclosed venues and entertainment activities, but not a rally.
High Court judge Johnson Lam Man-hon said yesterday the ordinance is intended to protect public safety and order.
Justice Lam said Hong Kong has learned lessons, including those from the Lan Kwai Fong tragedy of 1993 where 21 New Year revelers were crushed to death, which made lawmakers realize the need for structural safety and crowd-control measures.
He agreed with police that the requirement is based on safety concerns. As entertainment, the dance would have drawn spectators even though the event was held outdoors.
Organizers may not have had the right or means to control the behavior of the public, particularly when it came to the pedestrian precinct.
Justice Lam said the law does not just apply to indoor events, but also to those outdoors.
Although the rally expressed an anti-discrimination message and was not primarily public entertainment, entertainment it was.
The judge also pointed out that the application for entertainment license restrictions does not violate Basic Law guarantees of freedom of assembly and expression, because the regulations provide a reasonable and effective early warning mechanism to ensure the safety of all participants and those staying in the vicinity.