Each October, millions of people around the world submit applications for a lottery with a unique prize: a U.S. green card. For people in countries that have sent few immigrants to the United States, the annual Diversity Visa lottery is one of the only ways to legally immigrate to the United States, turning it into a symbol of the American Dream for many aspiring immigrants.

Now, however, some visa lottery winners may find themselves shut out. The Supreme Court’s decision to let the Trump administration enact certain provisions of its Muslim ban, as well as new guidance from the Department of State on how to do so, may slam the door shut on visa lottery winners from the six majority-Muslim countries affected by the ban.

The lottery program is small — it issues just 50,000 visas a  year — but it looms large abroad, where it has become a symbol of U.S. openness. By implementing the ban against visa lottery winners, the Trump administration not only thwarts their individual hopes and dreams, but also sends a message that the United States no longer stands as a beacon of hope.

Created as part of the Immigration Act of 1990, the visa lottery was a consequence of a 1965 immigration law aimed at dismantling the existing racist quota system that had heavily favored white Europeans for more than four decades. Congress instead created a system based almost entirely on family reunification.

Under this system, U.S. citizens and permanent residents could petition for their relatives to join them. As a result, over the last 50 years, most immigrants have come through the family system — and increasingly from just a few countries in Asia and Latin America.

The Diversity Visa program was designed to solve a problem: People without family ties to the United States had almost no opportunity to legally immigrate. But despite its name, the motivation behind the program came less from a desire to diversify the immigrant population than to whiten it.

The drive for the Diversity Visa program began in the late 1980s, when tens of thousands of Irish fled economic problems in Ireland and moved to the United States without going through the formal immigration procedures. Unlike previous generations of Irish immigrants, they no longer enjoyed privileged access to visas based on their nationality, and because few people from Ireland had emigrated in the booming postwar years, aspiring emigrants in the 1980s had no close relatives to sponsor them for visas.

In the country without permission, they found themselves castigated in the United States as undocumented immigrants.

Undocumented Irish immigrants and Irish Americans, through groups like the Irish Immigration Reform Movement, lobbied Congress to “legalize the Irish” already in the U.S. and to make sure future visas would be reserved for the Irish. Policymakers were moved by their plight, not least because the image of the Irish immigrant contrasted starkly with who they imagined were “illegal aliens.”

But the Irish and their allies in Congress needed to deflect criticism that they were proposing a special gift just for the Irish. They framed the program as an issue of diversity, borrowing the word from a 1981 report by the Select Commission on Immigration and Refugee Policy that identified cultural diversity as an important goal. The choice of words reflected the popularity of diversity as a cultural value in a country that was rapidly becoming more racially and ethnically diverse.

But proponents of the Diversity Visa also used the concept to subtly address white anxiety about the demographics of recent immigration, which after the 1965 reforms came overwhelmingly from Asian and Latin American countries rather than Europe. The visa program, in creating space for more Irish and European immigrants, aimed to diversify immigration by making it whiter.

Thus, when Congress created the Diversity Visa lottery in 1990, it did so mostly to benefit immigrants from European countries who had historically sent many immigrants but had recently sent few, like Ireland. But to make the program appear unbiased, they also included countries that had never sent many immigrants to the U.S.

The program had unintended effects. It opened a door to significant new immigration from all over the world, particularly Africa, where people tended to face humiliating refusals when trying to get a visa to travel abroad.

Offering something rare and valuable, the visa lottery became an annual cultural event, with banners, posters, radio announcements, and now Internet ads appearing like clockwork each autumn when lottery registration opens. By making concrete the possibility of immigrating to the United States, the visa lottery provided to people even in remote villages tangible access to the idea of the American Dream. As one repeated lottery applicant in Ghana told me, holding the lottery showed that “in the whole world, it is only America that is open.”

The program had real consequences for U.S. immigration. Around 360,000 African immigrants lived in the United States in 1990; that number has now risen to more than 2 million. More than 400,000 African immigrants came through the lottery — the most of any region.

The origins of the program as an effort to “legalize the Irish” have faded as Africans, Asians and others have made the lottery their own. Immigrants from these regions have dominated the list of visa recipients in recent years. About 10,000 people from the list of six countries affected by the Muslim ban, for example, were selected as winners in the 2015 lottery and were invited to apply for a green card. Around a third of them received a visa.

Because the visa lottery openly celebrates cultural differences, at least in the eyes of the people who play, it has amplified a message that the United States is a generous, open and diverse country where anyone can access opportunity and achieve their dreams.

In blocking visa lottery winners because they hail from six majority-Muslim countries, President Trump’s administration discounts those values, harms the individual lottery winners who dream of life in America, and squanders the good will earned by hosting the annual lottery.