It is important when organizing support for a cause to remind people how much remains to be accomplished.

While same-sex marriage is now a reality, it is still legal to fire people because of their sexual orientation or gender identity in more than half the states.

There is also a danger in premature predictions of complete victory. While the support we are receiving from businesses in opposition to the use of religion as a defense of discriminatory practices is encouraging – and, at least to me, pleasantly surprising – this battle continues.

But there is an opposite error to which some activists are prone: minimizing the progress we have made, especially when it is so significant. Celebrating victories is as important a factor in motivating people to keep fighting as the reminder that they are not yet complete. And the 50th anniversary of the passage of a bill that drastically changed our immigration policy for the better is an irresistible occasion to do so.

That bill, the 1965 Immigration and Nationality Act, was hailed – accurately – as a major breakthrough in the fight against official racism in America. It ended the quota system that reserved nearly all of the slots available for immigrants for white people, especially those from Northern and Western Europe.

It began as an initiative of President John F. Kennedy and was passed by a heavily Democratic Congress with strong support from President Lyndon Johnson. It was one of the first examples of the great legislative skills of Sen. Ted Kennedy.

Every liberal organization in the country put it high on its legislative agenda: the ACLU, the NAACP, Americans for Democratic Action, etc.

And among its provisions was one which was designed – and explicitly worded – to strengthen the prohibition against immigrants who were gay, lesbian, bisexual and transgender.

Not only did this widely hailed liberal accomplishment reinforce an existing ban on protecting America from LGBT foreigners, it also was adopted with no dissent by the overwhelmingly liberal Congress that had been elected in the anti-Barry Goldwater landslide of 1964.

People like me were first banned in the immigration law adopted at the turn of the 20th century, along with anarchists, the mentally ill, paupers and other obvious undesirables. The exclusion was of “people with a psychopathic personality.” This kept the statute books from having to include any explicit reference to sexual practices, but everyone knew that it meant us. It was never consistently enforced, but it was applied from time to time. For example, those seeking either permanent or temporary residence – the law applied to both categories unconditionally – who carried gay or lesbian literature with them were sometimes turned away.

Given the universal homophobia that prevailed in the United States and elsewhere, there was no known resistance to this rule until the first stirring of what was then called the gay rights movement in the ’50s. But then a legal challenge came from a non-citizen resident to whom it was applied. He argued that while he might be a homosexual, he was not a psychopath.

Despite the decades in which the two were legally conflated, U.S. officials feared that the courts might agree with the argument, particularly since the Supreme Court that would ultimately decide it was presided over by Earl Warren and included William Brennan, Hugo Black and William O. Douglas. The government’s response was twofold. They defended labeling us as “psychopathic” in court but as a backup decided to support a more explicit provision. Linguistic prudishness had to give way to legal clarity.

By this time the immigration overhaul was ready for congressional action, and with no one objecting in either the executive or legislative branches, one part of the bill added “sexual deviancy” to the list of behaviors forbidden to soil America’s shores.

It turned out not to have been necessary because while there were three dissents, Warren and five of his colleagues ruled in the case that had been brought before the amended language that legally describing LGBT people as “psychopaths” was a perfectly acceptable justification for the ban. In summary, when the possibility arose that LGBT people might be legally eligible to visit America, two Democratic presidents and an overwhelmingly Democratic Congress worked together to prevent it, in a law which was enthusiastically supported by the full range of liberal organizations. The role of the most liberal Supreme Court in history was not to obstruct this, but in fact to reinforce it by ruling that it had been unnecessary.

This act of absolute bigotry no longer stands. By 1986 public opinion had already moved to the point where I was able to begin the process of repealing the provision in that year’s immigration bill. In 1995, 30 years after the ban was shored up, we were able to take the next step by persuading President Bill Clinton to extend eligibility for refugee status to people who suffer persecution in other countries because of their gender identity or sexual orientation.

I can think of no greater reversal of American public policy over this short a period.

Barney Frank is a retired congressman and the author of landmark legislation. He divides his time between Maine and Massachusetts.

Twitter: BarneyFrank