The ruling involved a subset of applicants who had won the right to apply for a visa under a lottery system aimed at fostering diversity.