SANTA ANA, Calif.—Orange County officials on Tuesday voted to condemn parts of California’s approach to immigration, aligning themselves with the Trump administration as the state increasingly stakes out an oppositional role.

At a packed public hearing, the county’s board of supervisors—all Republicans—also voted to support a federal lawsuit against California’s so-called sanctuary state law, which strictly limits when and how local authorities can cooperate with federal immigration authorities.

Supervisor...