So far, the U.S. Supreme Court has not weighed in on this but generally speaking the courts addressing the issue have not discovered a "right" to conceal one's identity in public via a mask. The Supremes have ruled that if stopped by law enforcement, states can require require a person in public to identify themself in Hiibel v. Sixth Judicial District, 542 U.S. 177 (2004). So currently, states and localities in most places are free to pass laws that forbid being masked so as to conceal one's identity in public or to restrict the time, manner, and place of wearing such. There has been some arguments that doing so prevents symbolic speech or burdens free speech rights in protests but so far, by and large, courts have not accepted such (California was an exception). If the law is carefully drafted to allow law enforcement after observing what may be criminal activity afoot under the reasonable suspicion std. (as used in Hiibel), then probably it will be held constitutional on its face.
Under common law, the old std. was that during the hours of mischief (aka dark), it was legitimate for town watchmen to stop and demand the identity and their state business of all those going about under the cover of darkness. The idea is that those with legitimate business will have no problem identifying themselves and stating their business--those who intend bad things will balk. Anyone wearing a mask outside of festivals like Carnival would be automatically suspect and required to stop and be identified. You see a brief example of the town watch in Shakespeare's play, Much Ado about Nothing where the leader of the watch Sgt. Dogberry is the comic relief.
It is similar in one sense to many states forbidding carrying locksmith tools or implements of burglary under specified conditions. Concealing one's identity, carrying tools that help burglary or violence, etc. during a demonstration or at night has generally been within the powers of government to curtail. Actions+speech make the constitutional analysis more complicated than a simple free speech case.
Regarding mask laws
https://www.nytimes.com/2017/04/26/us/protests-masks-laws.html