Allison Hope is a writer whose work has appeared in The New York Times, Washington Post, CNN, Slate and elsewhere. The views expressed here are the author's. Read more opinion on CNN.

(CNN) A young man I met while doing advocacy work once told me a horrific story that has stuck with me for years. He realized he was having trouble breathing. He knew the culprit was likely asthma, a life-long affliction for him. He was well enough to get himself to the emergency room at the small hospital near his town in New York's largely rural Hudson Valley. But when the staff learned that he was transgender, he said, they turned him away.

This young man, who shared his story with the request that he not be named, is lucky that he survived without emergency medical intervention. This scenario sounds horrific and sensational, but there are many more stories like this one, where transgender people and those who don't neatly fit into categories of male or female have been denied necessary health care.

The medical staff that denied this man critical medical care should be liable, by any standard of humanity. But a new court decision confirms that it may soon be perfectly legal to turn transgender people away from care simply because of who they are.

Judge Reed C. O'Connor of the US District Court for the Northern District of Texas Tuesday vacated a rule that prohibited discrimination against transgender people in health care. The rule, known as Section 1557 in the Affordable Care Act , implemented during President Barack Obama's administration, prohibited providers and insurers from denying care or coverage based on someone's gender identity.

The reason for the court's ruling that this policy should be changed? Religious freedom. The judge said that the rule protecting transgender people violated the Religious Freedom Restoration Act (RFRA), a 1993 federal law, which was passed with the intent of protecting Americans from discrimination on the basis of religion. Part of the legal argument Reed leaned on was that there is no standing law that prohibits discrimination against trans people on the basis of sex. This is precisely the legal question that is before the Supreme Court , in a case that was heard last week , and in which the Justice Department filed a brief arguing against including gender identity as part of the protections of the Civil Rights Act.

In a letter read by a representative, they said: "We find it interesting and hypocritical that (Barr) would invite us to this event commemorating a hate crime law named after our son and Mr. (James) Byrd (a black man killed in 1998 by white supremacists), while at the same time asking the Supreme Court to allow the legalized firing of transgender employees. ... Mr. Barr, you cannot have it both ways. If you believe that employers would have the right to terminate transgender employees just because they are transgender, then you believe they are lesser than and not worthy of protection. If so, you need not invite us to future events at the Department of Justice that are billed as celebrating the law that protects these same individuals from hate crimes... " Their comments prompted a standing ovation from the crowd, which included DOJ attorneys. In a related and powerful moment on Wednesday , the parents of Matthew Shepard, a 21-year-old killed in a violent homophobic attack in 1998, took aim at Attorney General William Barr for hypocrisy in a speech at the Justice Department (marking the anniversary of a hate crimes law named partly after Shepard).In a letter read by a representative, they said: "We find it interesting and hypocritical that (Barr) would invite us to this event commemorating a hate crime law named after our son and Mr. (James) Byrd (a black man killed in 1998 by white supremacists), while at the same time asking the Supreme Court to allow the legalized firing of transgender employees. ... Mr. Barr, you cannot have it both ways. If you believe that employers would have the right to terminate transgender employees just because they are transgender, then you believe they are lesser than and not worthy of protection. If so, you need not invite us to future events at the Department of Justice that are billed as celebrating the law that protects these same individuals from hate crimes... " Their comments prompted a standing ovation from the crowd, which included DOJ attorneys.

The threatened reversal in health care policy is a profound blow to the LGBTQ community and our health. Since the rule change under the Affordable Care Act in 2010 , transgender people were for the first time able to get coverage for and greater access to medically necessary treatment for their gender dysphoria, including mental health care, hormone therapy, and surgery. It also meant they were able to get care for everything else -- from checkups to preventative care and emergency care -- with less fear of being turned away, denied care or discriminated against for being transgender.

None of this is what the Religious Freedom Restoration Act was intended to do; the reasons for passing it involved protecting minority religious groups against discrimination. The cases included people who were minorities, like a man who had been denied the ability to wear his turban on the job, as was dictated by his religion. The bill was introduced by a New York Democrat , endorsed by groups like the ACLU , and signed into law by former President Bill Clinton , all Democrats with a long history of fighting for the underrepresented. The law was not intended to bastardize the notion of religious exemptions to allow majority groups to discriminate against already marginalized ones.

What's more, Tuesday's ruling could also also remove protections from discrimination based on termination of pregnancy . This would open the door for women to be turned away from receiving any kind of care, including a flu shot or a pap smear, or emergency care for a heart attack, simply because they legally terminated a pregnancy at some point in their past. A doctor or nurse or therapist can legally say, "I don't agree with your choices because of my religion and I don't have to serve you."

The implications are chilling.

JUST WATCHED Disturbing rise in hate crimes against transgender community Replay More Videos ... MUST WATCH Disturbing rise in hate crimes against transgender community 03:42

Transgender people already face stark health disparities, in part because they have historically been denied care. According to a study last year by the Center for American Progress , nearly one in three transgender people reported being turned away by a health care provider in the previous year. And more than one in five transgender people don't seek care to begin with because they fear being mistreated, according to a 2016 study by the National Center for Transgender Equality

This ruling only perpetuates discrimination.

The Health and Human Services Office for Civil Rights is still enforcing the other protections written into the Affordable Care Act, including against discrimination on the basis of race, color, national origin, age, or disability, as well as sex, though the latter does not extend to include LGBTQ people.

Get our weekly newsletter Sign up for CNN Opinion's new newsletter. Join us on Twitter and Facebook

Medical providers take an oath to "do no harm." By denying necessary health care to transgender people, they are causing direct harm to a demographic that is already staggeringly vulnerable.