By Tim Fitzsimons

A federal judge this week ruled against a lesbian couple who sued a Missouri retirement home for rejecting their apartment application because their marriage is not "understood in the Bible.”

Bev Nance, 68, and Mary Walsh, 72, were married a decade ago in Massachusetts and have been in a committed relationship for roughly 40 years.

From left, Mary Walsh and Bev Nance at their 2009 wedding in Provincetown, Mass.

When they applied to move into the Friendship Village senior living facility, they did so “because it is in their community, they have friends there, and it offers services that would allow them to stay together there for the rest of their lives,” said Julie Wilensky, an attorney representing the couple.

But once Friendship Village staff found that Nance and Walsh are married, they told the couple that they were not allowed to move in, because the home did not condone homosexuality. The letter they received said that the only married couples they accepted were those in unions between "one man and one woman."

The couple sued, alleging “discrimination on the basis of sex,” and a federal judge in Missouri ruled Wednesday that "sexual orientation rather than sex lies at the heart of Plaintiffs’ claims.”

LGBTQ groups decried the outcome, and the couple’s lawyers said “we disagree with the court’s decision, and our clients are considering next steps.”

Michael Adams, CEO of SAGE, which advocates for LGBTQ seniors, said, “This is sex discrimination, and it is against the law.”

“Mary Walsh and Bev Nance were discriminatorily denied admission to the Friendship Village retirement community for one reason only — because they are two women in a committed relationship rather than a woman and a man,” Adams told NBC News.

The couple’s lawyers made that argument in court: that because Walsh and Nance are women who are in a relationship with a woman instead of a man as is traditional, they would not have been prevented from moving in if their sex were male.

Judge Jean C. Hamilton, however, provided a different view of the case’s merits.

“At no time do Plaintiffs assert that had they been men involved in a same-sex relationship or marriage, they would have been admitted as residents in Friendship Village,” Hamilton wrote in the court’s decision. “Under these circumstances, the Court finds the claims boil down to those of discrimination based on sexual orientation rather than sex alone.”

Hamilton then dismissed the women’s claim, noting that the 8th U.S. Circuit Court of Appeals, which covers Missouri and other Midwestern states, ruled in 1989 that existing federal civil rights law “does not prohibit discrimination against homosexuals.”

The case Hamilton referred to, Williamson v. A.G. Edwards & Sons, is currently being challenged in court by the LGBTQ legal advocacy group Lambda Legal. The group is representing a man whose job offer was rescinded after the company found out he is gay. This case, Horton v. Midwest Geriatric Management, could be decided this year, and if the 1989 precedent is overturned, discrimination against LGBTQ people would become illegal at the federal level in all the states in the 8th Circuit: North and South Dakota, Nebraska, Minnesota, Iowa, Missouri and Arkansas.

The Supreme Court is also considering whether to take up one or several appeals court cases that address whether “sex” discrimination bans in federal civil rights law include discrimination based on sexual orientation and gender identity. There is currently a patchwork of mismatching laws across the U.S. regarding this issue.

FOLLOW NBC OUT ON TWITTER, FACEBOOK AND INSTAGRAM