With the dust settled in North Carolina, the state’s Republicans have made a clear choice: For them, allowing anti-LGBTQ discrimination is worth losing jobs and even elections.

This is the clear cost of HB2, the anti-LGBTQ law passed by the Republican-controlled legislature earlier this year that led to business boycotts and protests. Yet it remains the law of North Carolina after a brief, chaotic attempt to repeal it on Wednesday — all because Republicans insisted on keeping some form of anti-LGBTQ discrimination, even if it’s temporary, on the books.

The consequences of HB2

HB2 does two things: It overturns and nullifies all of North Carolina’s local anti-discrimination laws for LGBTQ people, which seek to ban discrimination based on sexual orientation and gender identity. And it prohibits transgender people from using bathrooms that align with their gender identity in schools and government buildings — due to a baseless myth that letting trans people use the bathroom for their gender identity would lead to men posing as trans to sexually harass and assault women in women's bathrooms.

The law has inspired an enormous backlash since it passed in March. Several businesses, including PayPal and Deutsche Bank, pulled job expansions in the state in protest of the law. The NBA and NCAA pulled sporting events, which also produce jobs. Several musicians, like Bruce Springsteen and Pearl Jam, canceled concerts. And more than 200 major CEOs and business leaders signed a letter asking Gov. Pat McCrory to repeal the law. By Wired's estimate, North Carolina as of September had lost $395 million — “more than the GDP of Micronesia” — as a result of the law.

Then came the November elections. Republicans did manage to hold the legislature — in part thanks to legislative districts, which were set up in 2011, that have now been deemed unconstitutional due to racial gerrymandering, leading to a potential special election next year.

But Republicans lost a huge election: the governor’s race. There, Democrat Roy Cooper, who ran with a message against HB2, defeated Gov. Pat McCrory, who enacted and championed the anti-LGBTQ law. The law played a big role in McCrory’s loss, pollsters said: As Public Policy Polling concluded in August, “There's a good chance that if not for HB2 McCrory would be favored for reelection at this point.”

A new deal offered Republicans a chance to atone

Republicans were offered an out from the disaster this week. It was a simple deal: The city of Charlotte would repeal its local ordinance, which protected LGBTQ people from discrimination in hotels, restaurants, and other public accommodations. Republicans in the state legislature, in turn, would repeal HB2.

Charlotte’s ordinance has been disproportionately important here because it inspired Republicans to pass HB2 in the first place.

Charlotte enacted its ordinance to fill a gap in state law: North Carolina, like most states, lacks civil rights laws that prohibit discrimination based on sexual orientation and gender identity in the workplace, housing, and public accommodations. By contrast, state and federal laws ban discrimination based on race and religion, among other enumerated traits, in these settings.

But in its new nondiscrimination ordinance, Charlotte included a provision that told local public accommodations to let trans people use the bathroom for their gender identity. Republicans in the state legislature, citing the baseless myth about trans people in bathrooms, said this posed a public safety concern. So Republican legislators passed HB2 in response to Charlotte’s statute.

Charlotte didn’t have anything to lose by going along with the deal announced this week; HB2 had nullified its local ordinance anyway, since the state law struck down all local nondiscrimination laws. But Republicans had a lot to gain: It was a way to save face and bring jobs back after an unnecessary anti-LGBTQ crusade had hurt the state economy and cost their party the governor’s mansion — all just in time for special elections next year.

Then the deal fell apart

On Wednesday, the deal collapsed.

Republicans apparently couldn’t reach an agreement on how to repeal HB2. Reporting behind the scenes suggested that Republicans kept trying to add special conditions to a repeal, like a “cooling off period” — essentially, a temporary ban — on cities and counties passing local laws that protect LGBTQ people from discrimination following HB2’s repeal.

Democrats in the legislature pushed back, arguing (correctly) that the deal between Charlotte and North Carolina was a full repeal of Charlotte’s local ordinance and North Carolina’s HB2.

In the end, there weren’t enough votes from Republicans alone to pass the repeal with a “cooling off period.” So despite calling a special session to repeal HB2, the legislature closed the day after accomplishing nothing.

North Carolina Republicans have released various statements blaming everyone else since then — Charlotte, Democratic legislators, the governor-elect who isn’t even in office yet. But it’s clear who’s to blame: The Republicans who are so focused with allowing discrimination against LGBTQ people that even their repeal of an anti-LGBTQ law had to include a ban, even a temporary one, on municipalities protecting LGBTQ people from discrimination.