A ruling Tuesday in a Utah court indicates just how much further we have to go, in various parts of the country, when it comes to LGBT equality. Judge Scott Johansen ruled that married couple April Hoagland and Beckie Peirce should not be foster parents simply because they are gay, in direct violation of Utah state law, as Slate reports.

Hoagland and Peirce were legally married in 2014 and became licensed foster parents earlier this year, and had been caring for a one-year-old baby for the past three months. The child's biological mother endorsed the couple and had even asked them to pursue adoption, and as part of the state's moves to terminate the mother's parental rights, the 7th District Juvenile Court held a hearing about the child's foster placement. Johansen ruled that the child needed to be removed from the couple's home within seven days to be placed with a heterosexual couple, citing "scientific" research that children raised by heterosexuals fare better.

There is actually no such research, but as of now the Utah Division of Child and Family Services (DCFS) has to abide by Johansen's ruling. But, as the Salt Lake Tribune reports, the DCFS may consider an appeal if they "feel like the decision is not best for the child."

"No child should be denied stability and separated from a loving family because of a judge’s baseless beliefs about lesbian and gay parents," says Elizabeth Gill, senior staff attorney at the ACLU of Northern California, speaking to SFist. "There is a clear scientific consensus that children of same-sex parents fare no differently than their peers. Claims to the contrary have been consistently rejected by courts."

Hoagland believes Johansen ruled based on his own religious beliefs, and she tells local station KUTV, "We are shattered. It hurts me really badly because I haven't done anything wrong."

A full transcript of the ruling has not been made public, but Hillary Clinton has already come out in support of the couple.

Hoagland and Peirce are already raising two children, who are Peirce's biological children, aged 12 and 14.

Slate points to a fair bit of weirdness in Judge Johansen's record, to boot.

In 2012, he ordered a mother to cut off her teenage daughter’s ponytail in public court [as punishment for the teen cutting the hair off a 3-year-old girl at a restaurant] and sent a boy to jail for getting a bad report card. In 1997, he was officially reprimanded for slapping a 16-year-old boy in court.

As CBS News reports, Peirce insists they will fight the decision before next Tuesday's deadline, saying, "We're not just going to sit back and take it."

Meanwhile, in a twist of irony, Salt Lake City has just elected its first lesbian mayor.

Update: And, just like that, clearly under pressure from state officials, Judge Johansen reversed his decision.