Mike Huckabee and Sen. Ted Cruz are furious.

After a federal judge jailed Rowan County, Kentucky, Clerk Kim Davis for illegally refusing to let her office issue marriage licenses, including to same-sex couples, the two presidential candidates said religious freedom was under attack in America.

"Those who are persecuting Kim Davis believe that Christians should not serve in public office," Cruz said. "That is the consequence of their position."

"Kim Davis in federal custody removes all doubts about the criminalization of Christianity in this country," Huckabee tweeted.

The two Republican presidential candidates — whose views aren't necessarily in line with the rest of the GOP field — characterized Davis's jailing as the government carelessly stomping on people's religious beliefs without making any attempt to be accommodating.

But that's wrong. The government offered to accommodate Davis's religious beliefs: The court told her she would be released from jail if she allowed her willing deputy clerks to issue marriage licenses while she excuses herself from the process altogether.

At least initially, she refused. To her, it wasn't enough to get an accommodation for herself. She wanted to be able to impose her religious beliefs on her whole office — and, as a result, the entire county government. That's not how religious liberty works.

How religious liberty is supposed to work

Here's how Davis's situation is supposed to work: If a same-sex couple shows up at a county clerk's office to get married, an individual official can refuse to grant them a license. But the official would have to hand the case over to another county staffer, who would then give the license to the couple. The issue is that individual government employees may refuse — based on genuine religious objections — to take part in a same-sex couple's marriage, but the county government as a whole has a compelling interest to accommodate the couple and avoid violating their constitutional right to marry.

So an individual county official can step aside to avoid issuing a marriage license to a same-sex couple, but the government has to find a way to issue a license to the couple in the end, and do so in a way that doesn't significantly slow down the process.

What's different in Kentucky is that Davis didn't step aside and say she wouldn't give out any marriage licenses, but instead ordered her entire office not to — even though some of her deputy clerks were reportedly willing to do so. Even after five of six deputy clerks publicly told a federal judge that they'd be willing to issue marriage licenses to same-sex couples, Davis said she would block them from handing out the licenses if she was released from jail.

Davis didn't step aside and say she wouldn't give out any marriage licenses, but instead ordered her entire office not to

So Davis was given the option to step aside and let deputy clerks give people, including same-sex couples, marriage licenses while she took no part in it. She rejected that offer. She didn't just want an accommodation; she wanted to stop her entire staff from doing what she disapproves of on religious grounds.

Faced with this situation, US District Judge David Bunning concluded that the only way the county clerk's office can function — meaning fulfill its legal duty to grant marriage licenses — was to keep Davis in jail until she either resigns or agrees to let her staffers give marriage licenses. This is as productive as incarceration can get: Since Davis, as an elected official, can't be fired under the law, incapacitating her in jail was the only way to let the county government work.

In the end, the judge allowed Davis's release from jail by enforcing this accommodation: Davis would be freed, but the release order warned that if she tried to interfere with her deputy clerks' issuance of marriage licenses, she would be punished again. So Davis doesn't have to violate her religious principles and directly issue licenses to same-sex couples, but her office does — exactly how religious liberty is supposed to work.

But this is short of what Davis originally demanded. She wanted to use her role as a government official to impose her religious views on others, including people on her own staff, in a way that discriminated against same-sex couples. That clearly violated the separation of church and state enshrined in the Constitution, so it's no surprise that a federal court didn't allow it.