John Newman fondly recalled the eight years he taught first and second grades in Vallejo public schools — he felt appreciated, and was once named “Teacher of the Year.” It was the 1990s, before he got sick and was told to leave the United States.

“I was accepted by co-workers, neighbors and employers,” Mr. Newman said. “But I was not welcome by the government.”

Mr. Newman, a Canadian, contracted H.I.V., which causes AIDS and nearly killed him. Breakthrough drugs brought back his health. Then he discovered that a law many considered cruel required him to leave his home. Sadly, he returned to Canada.

Now the stories of people like Mr. Newman are becoming public. Experts say tens of thousands shared similarly interrupted lives thanks to a 22-year United States ban on allowing foreigners with H.I.V. to live in this country.