IF ANYTHING, Tracy Thorne-Begland, a top state prosecutor in Richmond with a decade of courtroom experience, is overqualified for a judgeship on the General District Court. Mr. Thorne-Begland, who has prosecuted dozens of homicides and other major felonies, runs one of the biggest commonwealth’s attorney’s offices in Virginia. The caseload of the court to which he was nominated consists mainly of traffic violations, minor crimes and run-of-the-mill civil disputes over contracts and late rent payments.

But the judicial nomination of Mr. Thorne-Begland, a former Navy fighter pilot who is gay, was sabotaged by an ugly campaign of homophobic bigotry led by Virginia Republicans. In a vote at 1 a.m. Tuesday, the GOP-dominated House of Delegates, with an avowed homophobe leading the charge, killed his candidacy, thereby ensuring that Virginia state courts remain free of openly gay judges.

Although Mr. Thorne-Begland had the backing of Virginia’s Republican governor, as well as a Republican sponsor in the state House, Republicans cast all 31 votes against him, and more than two dozen GOP lawmakers either didn’t vote or abstained. That was more than enough to kill his nomination, which needed 51 votes to succeed. Just eight of 67 House Republicans joined 25 Democrats in voting for the nomination.

Mr. Thorne-Begland has been a champion of gay rights. Twenty years ago, as a Navy lieutenant, he denounced the military’s “don’t ask, don’t tell” policy on national television, an event that triggered his honorable discharge. He also served on the board of Equality Virginia, a gay advocacy group, and, with his domestic partner, is raising 7-year-old twins.

None of that has figured in his legal career. As Richmond’s chief deputy commonwealth’s attorney, he isn’t regarded as a gay rights advocate; he is seen as a consummately professional prosecutor.

But for House Republicans, and for the Family Foundation, an anti-gay group that stirred up opposition to Mr. Thorne-Begland’s nomination, his sexual orientation trumped his copious professional qualifications. Del. Robert G. Marshall (R-Prince William), who last year expressed the view that gays are “intrinsically disordered,” denounced the nominee as “an aggressive activist for the pro-homosexual agenda.”

Mr. Marshall — known in Richmond as “Sideshow Bob” — said that, as a gay man living with a domestic partner, Mr. Thorne-Begland had a lifestyle that would impede him from upholding Virginia’s constitution, which defines marriage as between a man and a woman. As if the nominee’s sexual orientation would cripple his ability to preside over traffic cases and misdemeanors.

Other GOP delegates impugned Mr. Thorne-Begland’s character by noting that he’d concealed his homosexuality when he enlisted in the Navy in the late 1980s. Never mind that the military’s own rules, reflecting America’s evolving views, have moved well beyond that debate.

No matter how they dressed it up, the Republicans’ opposition boiled down to old-fashioned prejudice. Even by voting at 1 a.m., they couldn’t hide the fact that bigotry and discrimination on the basis of sexual orientation is alive and well in the state of Virginia.