Democratic Senator Jeff Jackson said the repeal effort failed because Republicans reneged on their deal to bring the measure to a floor vote with no strings attached.
The moratorium on municipal bathroom regulations, described by Jackson as a "poison pill," withered Democratic support, and in the end all 16 Senate Democrats joined 16 Republicans in voting against repeal. Another 16 Republicans voted for it.
The Senate then adjourned without acting on the temporary municipal ban. The state's House of Representatives had already called it quits.
Democratic Governor-elect Roy Cooper accused Republican leaders of back-peddling on an agreement ironed out in lengthy negotiations. He said both chambers had the votes for a full repeal, but divisions within the Republican Party killed it.
"The Republican legislative leaders have broken their word to me, and they have broken their trust with the people of North Carolina," he said.
Senate Republican leader Phil Berger earlier defended the proposal to link repeal with temporary municipal restrictions as a genuine attempt at compromise, citing "the passion and disagreement surrounding this issue."
After Wednesday's vote, outgoing Republican Governor Pat McCrory blamed "well- funded left-wing interest groups" that he said "sabotaged bipartisan good faith agreements for political purposes."