The General Assembly recently passed a law invalidating a Charlotte ordinance allowing transgender people to use the bathroom of the sex with which they identify. Opponents of the ordinance cited privacy and safety concerns with allowing women to enter men’s restrooms and men to enter women’s restrooms, changing facilities, and locker rooms. Proponents hurled accusations of discrimination and radicalism.

North Carolina is not alone in dealing with the transgender bathroom issue. In January and February, more than two dozen similar bills were filed in state legislatures. Legislators in Illinois, Indiana, Kentucky, Mississippi, Missouri, Oklahoma, South Dakota, Tennessee, Virginia, Washington, and Wisconsin are considering bills allowing transgender people to use the bathroom or locker room that reflects their gender identity.

The General Assembly came back for a special session. The final vote in the House was 82-26, with bipartisan support. The vote in the Senate was 32-0; Democratic members of the Senate walked out, avoiding a vote altogether. Gov. Pat McCrory signed the bill into law hours later.

House Bill 2, disallowing the bathroom ordinance and clarifying local government authority, passed despite a lot of drama, press buzz, partisan bickering, and pundit posturing. But did it have to be so hard and so hurtful?

No one should minimize the heartache, struggle, and hardship that people dealing with sexual identity challenges face, especially young people. Senate Minority Leader Dan Blue said during the debate that a relatively simple court suit could have derailed the Charlotte ordinance without “scaring the bejesus” out of everyone. Amen.

Are costly lawsuits or sweeping legislation the only possible resolutions? Remember the controversy, legislation, and lawsuits surrounding magistrates objecting to conducting same-sex marriages? Couldn’t that have been solved with reasonable accommodation for everyone involved?

A common-sense photo ID provision preserving integrity in elections while accommodating those who needed extra help might have prevented ugly protests, voter confusion, and costly litigation.

When did working through tough challenges and coming to agreements become the last choice in problem resolution and governing?

One alternative to the Charlotte ordinance would be for all public facilities to provide a single-occupancy bathroom option for anyone who feels uncomfortable using a multi-stall bathroom. This would be open to anyone who wants additional privacy — senior citizens, parents with young children, and yes, transgender people. If there is a need to construct them, do so at taxpayer expense.

It’s different for private facilities. Government ought to respect the property rights of private business owners rather than mandating special accommodations. By allowing business owners the freedom to run their companies the way they choose and with motivation to succeed and make a profit, business practices eventually conform with public sentiment and demand without government coercion. Free markets work when left alone.

North Carolina is not a “home rule” state, meaning local governments are the creature and creation of the General Assembly — it’s in our state Constitution. There are some things cities just can’t do without creating inconsistencies in laws across the state, causing confusion and inequities, and jeopardizing the competitive position of the state’s business climate.

Passing the bathroom ordinance was way beyond Charlotte’s legal authority. Requiring private contractors to pay certain wages or regulate their employment practices is also way beyond the city’s authority. Charlotte leaders knew this and recklessly ignored the Constitution.

The speedily called special session and resulting legislation were necessary to ensure public facility privacy and security, statewide consistency in laws, and protection of rights. It also was necessary to remind local governments that their authority is limited.

It’s really a matter of rights: privacy rights, property rights, religious freedom rights, and the right to dignity and respect. North Carolina is a leader in protecting those rights. Let’s keep it that way.

Becki Gray (@beckigray) is vice president for outreach at the John Locke Foundation.