A gay softball association in the US can limit the number of heterosexual players on its teams, a federal judge ruled Thursday.

The decision to allow the North American Gay Amateur Athletic Association (NAGAAA) to enforce a rule of two "straight" players came in a lawsuit filed by three bisexual men who claim they were kicked out of the Gay Softball World Series because they "weren't gay enough," the Courthouse News Service reported.

US District Judge John Coughenour wrote in his ruling, "Plaintiffs have failed to argue that there is a compelling state interest in allowing heterosexuals to play gay softball."

"NAGAAA might very well believe that given the history of gay exclusion for sports, the only way to promote competition for all persons, and ensure that gay athletes have the same opportunities as straight athletes, is to create an exclusively gay community with exceptions for a small number of straight players," the ruling states. "It is not the role of the courts to scrutinize the content of an organization's chosen expression."

However, Coughenour said the lawsuit could proceed to trial because questions remained about the way the softball association applied its rule.

The suit was sparked when three men playing for a San Francisco-based team in the Gay Softball World Series in Washington state in 2008 were challenged about their sexuality by a rival team.

According to their complaint, the trio were summoned to a hearing room and quizzed about their sexual interests or attractions in front of around 25 people.

The men said organizers told them, "This is the Gay World Series, not the Bisexual World Series."

A trial is set for Aug. 1.