The reason why the court system is in such confusion is that discrimination against LGBT employees is not explicitly outlawed by federal law, and while some states and localities outlaw anti-LGBT discrimination, others don’t. Michigan, for example, does not have any state law that outlaws employment discrimination against LGBT people—it’s perfectly legal in the state to fire someone because of their sexual orientation or gender identity. In the absence of clear federal legislation on this issue, courts and agencies have been left to fight it out over the words that are included in federal law—namely, what the meaning of “sex” in “sex discrimination” is.

This has become an increasingly difficult problem since the Supreme Court ruled in favor of same-sex marriage last summer. Since more LGBT people can now get married, that means more people are seeking marital benefits and coming out at work, giving employers more opportunities to discriminate. But it’s been a confusing legal issue for a long time. Twenty-seven years ago, the Supreme Court did rule on one aspect of gender identity discrimination: It said that employers can’t force workers to express their femininity or masculinity in a certain way as a basis for promotions or continued employment. What that has meant, as the Seventh Circuit recently noted, is that someone can win a discrimination case if her boss fires her because of her butch haircut, but not if her boss fires her for being a lesbian.

Along those lines, the district court in the Michigan funeral home case didn’t accept the argument that the owner should be able to enforce its gendered dress code. But it also didn’t accept the EEOC’s longstanding argument that gender-identity discrimination is forbidden by Title VII. And that opened the way for the second, more significant part of the court’s decision: If the government forced the funeral home to keep Stephens on as an employee, that would place a substantial burden on the owner’s religious beliefs.

According to the decision, the funeral home “‘administers its dress code based on our employees’ biological sex, not based on their subjective gender identity.’” The owner, Rost, believes “‘the Bible teaches that a person’s sex is an immutable God-given gift and that people should not deny or attempt to change their sex.’” Because of this, Rost says, he “‘would be violating God’s commands’ if he let Stephens ‘deny [his] sex while acting as a representative of [the funeral home].’”

Following the logic of Hobby Lobby, the court ruled that a private business can make this kind of claim about religious conscience. While the EEOC argued that the funeral home should have to allow Stephens to dress according to her gender identity, the court argued that this wasn’t the least restrictive way for the government to protect against the alleged discrimination—the agency could have proposed that the funeral home create a neutral dress code, for example.