The full text of the Virginia law can be found at https://law.lis.virginia.gov/vacode/title18.2/chapter9/section18.2-422/ Ther are more or less similar laws in several other states.
The Virginia law was challenged on precisely the grounds suggested in the question by a member of the Ku Klux Klan who was wearing full regalia, including hood and mask, while passing out literature in a public place. He claimed, among other things, that the law deprived him of his First Amendment rights, and should be held void on its face. His conviction was upheld by the Virginia State Supreme Court. He then appealed to the Federal courts on a writ of Habeas Corpus in Hernandez v. Superintendent, 800 F. Supp. 1344 (E.D. Va. 1992) The Federal district court upheld his conviction. The First Amendment claim was dismissed because the court found that wearing the robes and hat without the mask would have served the same expressive function, and so the mask itself was not symbolic speech, the court said.
Here, the burden is on petitioner to demonstrate, in the first instance, that his mask-wearing amounted to constitutionally-protected symbolic speech. See Clark, 468 U.S. at 293 n. 5, 104 S. Ct. at 3069 n. 5. The record reflects that petitioner's proof fell short in this regard.
...
But even assuming the propriety of de novo review, the Court affirms the state courts' conclusion that no First Amendment protection attaches to petitioner's mask-wearing conduct.
...
Thus, on the facts presented, petitioner's mask-wearing did not constitute expressive conduct entitled to First Amendment protection because it did not convey a particularized message. See Spence, 418 U.S. at 410-11, 94 S. Ct. at 2730. Given this, the First Amendment analysis properly ends. This Court, accordingly, upholds the decisions of the state courts and dismisses this claim.
The Hernandez court went on to observe that:
The exceptions for holiday or theatrical masks do not create a distinction between non-political and politically-motivated mask-wearing. Indeed, politically-motivated mask-wearing for traditional holiday purposes (for example, wearing a Halloween mask caricaturing a political leader) or bona fide theatrical purposes do not violate the statute. The statutory exceptions are not content-based restrictions; rather, they are akin to permissible time, place, and manner restrictions. See Clark, 468 U.S. at 293-94, 104 S. Ct. at 3069; cf. Frisby v. Schultz, 487 U.S. 474, 108 S. Ct. 2495, 101 L. Ed. 2d 420 (1988). Simply put, the statute does not criminalize politically-motivated mask wearing.
This decision did not discuss further the case of "politically-motivated mask-wearing" (such as wearing a Nixon mask during a march, or the image of any other political figure) not connected with a Halloween or similar costume.
Hernandez's claim that he was not wearing the mask to conceal his identity (as the statute requires for conviction) was not addressed, because he had conceded at trial having violated the statute in order to make his constitutional argument. He was held to have therefore admitted every element of the offense, and a dispute on appeal was not heard.
A news report from CNN mentions a case from NY City that reached the US Court of Appeals in 2004, but I do not have a citation or a link to a decision, That case seems to have also been decided on the grounds that the mask was not "symbolic speech".
The three-judge federal panel said the mask was not protected because it does not convey a message independently of the KKK's robe and hood.
That news report mentions mixed prior decisions.
a 1992 law review article, "'Who Goes There?' -- Proposing a Model Anti-Mask Act" by
Stephen J. Simoni argues
that most of the existing [ant-mask] statutes are unconstitutional.
and goes on to propose a new model anti-mask law which the author thinks would pass constitutional review. It cites the arguments against the various current laws in some detail, citing First Amendment decisions on other symbolic speech issues.
The Wikipedia article on "Anti-mask laws discusses the history and current scope of US laws on the subject, citing or mentioning several court cases, although none at the US Supreme Court level.
A Chicago Tribune article "The Constitution doesn't guarantee you can protest with a mask" hinges on a recent Georgia case, and argues that such laws are not a threat to free speech.
The original context for such laws seems to have been the terroristic actions of masked members of the Ku Klux Klan, who were thought safer from law enforcement when masked. Arguments that masks may be worn to aid in criminal activity or as a form of intimidation may be enough to avoid this and similar statutes being held as unconstitutional on their faces. If a person were arrested for wearing a mask as an act of political protest, without a serious effort to conceal identity, or alleging that concealment was required to avoid retaliation for expressing unpopular ideas, such an arrest and conviction might be overturned on First Amendment grounds.