A law has to exist that gives states and the federal government the ability to do what they are doing and that law needs to not violate special protections built into the Bill of Rights.
With a state of emergency declared, some things can temporarily be enacted that under normal circumstances would not be legal.
I don’t know if all the lock down rules are legal, but I wouldn’t be surprised to find out that governments have overstepped their bounds.