(CNN) A federal judge ruled that a Virginia law requiring couples to reveal their race in applying for a marriage license is unconstitutional.

The lawsuit against the Virginia State Registrar and others was filed after three couples said they were denied marriage licenses in the state after they refused to check a box disclosing their race on their applications.

Finding that the statute violates the 14th Amendment, Judge Rossie D. Alston wrote in his ruling Friday that requiring the couples "to disclose their race in order to receive marriage licenses burdens their fundamental right to marry," Alston wrote.

"(T)he statutory scheme is a vestige of the nation's and of Virginia's history of codified racialization," the judge wrote.

"The Commonwealth of Virginia is naturally rich in its greatest traditions," Alston wrote. "But like other institutions, that stain of past mistakes, misgivings and discredited legislative mandates must always survive the scrutiny of our nation's most import institution ... the Constitution of the United States of America."

Read More