A federal judge in Alexandria has rejected a West German immigrant's request to become an American citizen because the immigrant admitted he has engaged in homosexual relations.

The order by U.S. District Court Judge Oren R. Lewis represents the first legal test of the issue in Virginia, according to lawyers for the West German immigrant and for the Immigration and Naturalization Service. Courts in other states have issued conflicting rulings on whether homosexuality constitutes a bar to U.S. citizenship.

Lewis' ruling stems from a U.S. citizenship request by Horst Nemetz, 41, who immigrated to the United States in 1967 and now runs a beauty salon in Springfield. Nemetz acknowledged during a naturalization hearing that he has engaged in homosexual relations with a roommate since shortly after his arrival in this country.

His lawyers argued that Nemetz's homosexual activity was "of a private and consenting nature" with an adult and should not be construed as a bar to U.S. citizenship. Carolyn S. Motes, one of Nemetz's lawyers, said Nemetz would consider appealing the court ruling.

The Immigration and Naturalization Service opposed Nemetz's citizenship request, arguing that homosexual relations constitute sodomy, a felony under Virginia laws.

The Immigration Service said it opposed Nemetz's citizenship request not only because of his homosexuality, but because he engaged in acts "proscribed by statute" in Virginia.

In his ruling, Lewis accepted the immigration agency's arguments. "Sodomy, as defined by Virginia law, is a crime involving moral turpitude," the judge wrote. He said that Nemetz had "failed to establish that he has been for the past five years a 'person of good moral character,'" a requirement set by U.S. citizenship laws.

Lewis took note of Nemetz's argument that his homosexual activity took place in private between consenting adults, but the judge rejected this assertion, saying it "is not in accord with Virginia law."