Carl Hill arrived in America three weeks ago, with a camera, his lover, and a Gay Pride button pinned to his jacket.He had flown Pan Am, from London. He and his lover, Michael Mason, planned to cover the San Francisco Gay Freedom Day Parade for the Gay News, which is an English semimonthly printed in London, the name of which was emblazoned on his T-shirt.

Hill from a separate line at San Francisco airport, watched Mason clear immigration. It was midafternoon. By Hill's own account, this is what happened when he reached passport control:

A uniformed official handed a piece of paper to the woman about to stamp Hill's passport.

Hill, who had seen the official looking at him as he stood in line, said, "I don't think you like me, do you?" He was smiling.

The official did not smile. The official said he had two questions for Hill and that Hill must answer them truthfully."Have you ever had a homosexual experience?" asked the official.

"how do you want me to answer?" asked Hill.

"are you a practicing homosexual?" the official asked. "Yes," said Hill. The woman at passport control folded Hill's papers and handed them to the immigration official. Hill was taken to a small room at the airport and told that practicing homosexuals may not enter the United States. He had two options, Hill was told: he could get on the next flight for London, or he could stay in America and submit to a psychiatric examination, which would almost certainly result in his expulsion from the country.

Carl Hill, 32 years old, antique furniture restorer and occasional photographer had bumped up against U.S. Code Title 8, Section 1182, Excludable Aliens, General Classes. There are 31 subsections of excludable aliens, including anarchists, prostituted, drug addicts, alcoholics, and the mentally retarded, but the category under which Carl Hill was detained was "[4] Aliens afflicted with psycopathic personality, or sexual deviation, or a mental defect."

Sixteen years ago, a Canadian national named Clive Boutilier applied in New York for American citizenship. Boutilier had been arrested four years earlier in New York on a charge of sodomy, [which was ultimately dismissed], and at the government's request, he submitted an affidavit in which he said that since 1959 he had shared an apartment with his male lover. He was refused citizenship and ordered deported on the grounds that his homosexuality constituted psychopathic personality." The Supreme Court upheld that ruling: "The legislative history of the Act," wrote Justice Tom C. Clark, referring to the 1952 Immigration Act, "indicates beyond a shadow of a doubt that the Congress intended to phrase 'psychopathic personality' to include homosexuals such as petitioner."

That was the law, on June 13, as Carl Hill sat in a hallway at San Francisco airport and tried to figure out what to do. It was wonderfully American, in its way, bureaucracy and experimentation all tangled up together: in 10 days, 200,000 homosexuals were going to march down one of the main thoroughfares of a major California city, wearing green hair and business suits and huge banners reading, DYKES ON BIKES. And an immigration official, formal but polite, was telling a slender antique restorer he could not enter the country because his lapel button read "Gay Pride."

Hill decided to fight the immigration people. He called his San Francisco tour arranger, who was gay. The tour arranger called the owner of Hill's hotel, a gay-oriented holtel. The hotel owner called Dan Knutson, an attorney for a San Francisco legal firm called Gay Rights Advocates, and thus was born Hill V. Richmond, the U.S. District Court case that names as a defendant Dr. Jules Richmond, surpervisor of the U.S. Public Health Service and surgeon general of the United States.

"we're going to have an opportunity for the first time to test the legalities of this," says Knutson, who is coming to Washington on Tuesday to take a deposition from Richmond. "it is of course a matter of enormous importance to the gay rights movement that this law be thrown out."

The lawsuit, now scheduled for trial on August 13, contends that homoexuality is not either "pathological" or a "mental defect," particularly in light of the recent American Psychiatric Association and American Psychological Association actions removing homosexuality from their lists of mental disorders. Homosexuality, the argument goes, if not per se a medical condition at all.

So any examination to determine homosexuality [as now required by immigration law] would not be a medical examation, the lawsuit agues -- and therefore would be outside the statutory authority of the Public Health Service. And it would cause "irreparable injury, indignity, loss, and damage in that it would cause him [Hill] to be immediately excluded from this country with no right of direct judicial review, and with consequent stigmatization and damage to his business and personal affairs," the lawsuit says.

No statistics are kept on the annual number of homosexuals turned away at United States borders. [Less than two weeks ago, a German man was denied entrance in Minneapolis when an official found a gay-oriented magazine in his suitcase and the German said he was bisexual.] "By and large," says Monica Bell, deputy district director of the U.S. Immigration Service, "we're not in the business of stopping people at the border inquiring of your sexual preference?' . . . We inspected 280-some-odd million people last year, and that's one helluva lot of people, and quite frankly we don't have time to go through all 32 categories to see if they're inadmissable to the United States.

"but on the other hand, when someone presents himself . . . If someone were to come through with a sweat-shirt saying, 'i am a practicing prositute, and proud of it,' they'd be subjected to exactly the same procedure."

Meaning we tolerate open homosexuality for American citizens but not for visitors?

"i wish the guy had never put on that damn T shirt," Bell says, with some exasperation. "the law is pretty clear. It says they will be ferrered [to medical examination]. . . Your personal opinion or my personal opinion as to whether or not these people are harmful or not is irrevelant in the face of that statute."

The vacation has been altogether a remarkable one of Carl Hill, who apparently leads a calm existence in London, and had never before seen the United States. The story of his airport troubles aroused so much attention here that both he and Mason were taken in as small-scale visiting dignitaries: they were asked to walk at the head of the Gay Freedom Day parade, and when the gay marching band performed at Grace Episcopal Cathedral, San Francisco Mayor Dianne Feistein Publicly apologized to both men for the trouble they had been through.

"people just have been absolutely amazing," says Hill. "That in itself was slightly overwhelming." Mason has returned to London, where he edits the Gay News; Hill will stay in America on "parole," a technical Immigration Service term meaning he has physically entered the United States but has not been officially admitted until his trial.

He has received flowers, tickets to the King Nut exhibition, and an invitation to stay in an elegant house in Pacific Heights -- all of which he will respond to, he says, when he recovers from the asthma that seems to have struck him in America. And he still thinks about the immigration official who pluckeld him out of the Pan Am pasport line. "I'd very much like to meet the guy who started all this," says Hill. I'd like to talk to him and find out how he feels." CAPTION: Picture, Carl Hill, by AP