Early on, it was clear that they had the White House on their side. “Churches in Texas should be entitled to reimbursement from FEMA Relief Funds for helping victims of Hurricane Harvey (just like others),” President Trump tweeted in September. From a legal perspective, time was arguably on their side as well. The hurricanes hit roughly one month after the U.S. Supreme Court decided Trinity Lutheran v. Comer, ruling that governments can’t discriminate against religious organizations in awarding grants simply because of their religious nature. The lawsuits relied heavily on that decision, reasoning that the disaster-aid exclusions were analogous to the situation presented in the case.

In January, FEMA took steps to resolve the dispute with new guidelines on eligibility for its public-assistance program, which provides grant money for debris removal, emergency protection, and facility repairs for certain kinds of organizations. In light of Trinity Lutheran, it decided, it would reinterpret the Stafford Act, the law that governs eligibility for disaster aid.

While these new guidelines changed the situation for houses of worship, they were ultimately impermanent and vulnerable to revision under a new administration. That’s where Congress’s new budget bill comes in: It revised the text of the Stafford Act itself. Under the new law, which was signed by Trump on Friday, houses of worship can’t be excluded from aid provided to other nonprofits, including schools, hospitals, and elder-care facilities, just because they’re led by people “who share a religious faith or practice.” This includes money for the “repair, restoration, and replacement of damaged facilities.”

That’s where things get legally tricky. Scholars are split on how the Constitution should be interpreted when it comes to government money for houses of worship. Over the last few decades, courts have steadily pushed interpretations that allow government grants to religious organizations in certain contexts, like providing educational materials to parochial schools or giving money for neutral renovations, such as resurfacing a playground.

Those who favor stricter rules separating church and state have worried that this will open the way to government money supporting explicitly religious functions. In her dissent to Trinity Lutheran, Justice Sonia Sotomayor argued that government money that goes toward an allegedly neutral purpose at a church is still government money supporting a church: It “cannot be confined to secular use any more than lumber used to frame the church’s walls, glass stained and used to form its windows, or nails used to build its altar,” she wrote. Arguably, her fears are actualized in the new FEMA law, which directly supports the rebuilding of church walls and altars after they’ve been destroyed in natural disasters. As Jason Lemieux, the director of government affairs at the Center for Inquiry, wrote in a statement, the new law would “require Americans to fund the repair of religious buildings with no regard for their individual religious or moral beliefs. … If churches want protection against damage from natural disasters, that’s what insurance is for.”