The question is, I'm afraid, backwards. One shouldn't ask "Where is a state given authority to do X" but rather "Is a state forbidden to do X".
In the US system the state governments have wide authority to pass laws to regulate everyday life in ways which the people (or at least the members of the legislature) think good. Court decisions often call this "the police power" which can mislead people, because it has nothing to do with police in the sense of cops. Rather it is that they have the power to police society, that is, to regulate it.
This power is limited by restrictions in the US Federal Constitution, including those imposed via the Fourteenth Amendment. In many states it is further limited by restrictions in the state constitution. But when a state law purports to be for the general good, and the regulation has a rational relation to the good aimed at, and none of the restrictions from the constitution apply, then the state can pass and enforce the law.
Now let us consider whether the above quoted Virginia law, and the more or less similar laws in a number of other states, violate any of those restrictions. The US Supreme Court has said that the constitution provides a right to privacy, although this is not explicitly stated. If I am not mistaken, they have also said that people may engage in anonymous speech and anonymous protest (I will add cites later today). Those right might well be infringed by an anti-mask law in the case of a person who wants to protest anonymously because s/he fears retaliation.
No case along those lines has been decided by the US Supreme Court to date (to the best of my knowledge). Lower court cases have taken differing views. (See cases cited in the answers to the previous question about this law.) Those defending these laws say that they are aimed at people who may commit crimes and try to evade arrest by hiding their identities, and at those who use masks as a form of intimidation. They say that legitimate, non-violent protesters, will not be prosecuted under them. So far, no case where such a person has been prosecuted seems to have reached the Supreme Court.