A gender-neutral bathroom at the University of California, Irvine. (Lucy Nicholson/Reuters)

IT IS curious that a Republican state legislator in Virginia is hoping to legislate discrimination and thereby emulate North Carolina, whose notorious “bathroom bill” last year cost the state hundreds of millions of dollars in lost sporting events, tourism, conventions and concerts, to say nothing of jobs forfeited when prominent companies such as PayPal squashed planned expansions. That Del. Robert G. Marshall (Prince William) wants to copy the Tar Heel State’s disaster and risk a similar firestorm of disrepute in Virginia suggests an agenda that does not exactly enshrine the commonwealth’s best interests as his No. 1 priority.

Mr. Marshall, a culture warrior who relishes provocation, the more incendiary the better, insists he is a righteous guardian of women and girls who might be groped or otherwise violated by predatory men posing as women in restrooms at schools, public universities and other government buildings. Never mind that he is an enthusiastic supporter of America’s most prominent self-professed groper of women: President-elect Donald Trump. (“Not voting for Trump would be a horrible mistake!” he wrote.)

What really rankles Mr. Marshall is the very existence of transgender individuals. He warns of the threat they represent — that desperate boys and men will pretend to be transgender “to make a move on some teenage girls or women” in bathrooms, notwithstanding his inability to cite a single instance in Virginia of such misconduct.

Once upon a time in Virginia, and elsewhere in the Jim Crow South, it was black people whom lawmakers sought to repel from public facilities used by whites. Now it’s transgender individuals, who represent a new kind of “other,” anathema to sentries of the old guard such as Mr. Marshall who prefer an America in which people who are different can be safely defined as deviants, without igniting a politically correct tumult.

It’s unlikely that Mr. Marshall’s bill will become law, or even emerge from the Republican-dominated legislature in Richmond, whose leadership is still licking its wounds from a hullabaloo five years ago triggered by a bill that mandated transvaginal ultrasounds for women considering abortions, the better to punish and humiliate them. Even if Mr. Marshall’s obnoxious legislation were somehow to clear both houses of the General Assembly, Gov. Terry McAuliffe, a Democrat, would veto it.

Still, it’s likely to attract GOP votes in the House of Delegates, where the idea of marginalizing minorities — see: voting restrictions — retains a certain allure. The legislation would not only discriminate against transgender individuals; it would also press public school teachers and principals into the project by requiring that they report on any unauthorized bathroom use and convey the information to parents.

That’s an effective way to foster prejudice and confusion at any school, costs that Mr. Marshall is more than willing to bear in the cause of intolerance.