A California law requiring diversity on corporate boards of directors has been struck down in a blow to the state's efforts to address racial and gender disparity in the workplace.

The law was found to violate the state constitution by Judge Terry Green of Los Angeles County Superior Court.

The law went into effect in 2020. It requires publicly traded companies based in California to have board members who are from underrepresented communities, including people of several races and ethnic groups. The bill was signed into law by the governor, who claimed it was a victory for racial justice and empowerment.

The lawsuit was filed a month after the law was signed.

Judge Green didn't give a reason for his decision. The law was described as a bit arbitrary by him in one hearing.

Daily business updates  The latest coverage of business, markets and the economy, sent by email each weekday.

Tom Fitton, president of Judicial Watch, decried the law as one of the most blatant and significant attacks on constitutional prohibitions against discrimination after the ruling.

California has led the country in pushing companies to have at least one woman on their boards. Penalties are imposed on companies that do not comply.

According to a report from California Partners Project, a nonprofit focused on gender equity, the number of women on boards has more than doubled since the law was passed. The group said that more than half of new board appointees were women.

The California Partners Project said the decision was disappointing but not determinative.

The Securities and Exchange Commission approved a rule that will require companies listed on its exchange to disclose the ethnic and gender makeup of their boards and have at least two diverse members. Some states, including Maryland and New York, require companies to report board diversity statistics, but not mandatory quota.

The same argument was made against the California gender diversity law by Judicial Watch. The Securities and Exchange Commission approved diversity rules.

It was not clear if California would appeal the ruling. The office of the secretary of state did not respond to the request for comment.

David A. Bell, co-chairman of corporate governance at the law firm Fenwick & West, said that the decision was not a complete surprise and that California's gender diversity law may face a similar fate.

If Judge Green's decision holds up, Mr. Bell doesn't think it will change much for companies that are already being pushed to change.

He said that the benchmark has already been set by a lot of different stakeholders.