The courts have ruled in other cases that behavior that puts the health of others at risk can be regulated. That’s why you can’t smoke in a bar in most states —second-hand smoke puts others at risk. Not wearing a mask also puts people at risk, so the government can mandate you wear one. Private businesses can also legally require masks. It’s like a “no shirt, no shoes, no service” policy. As long as the store applies to everyone equally, it is legal.