The judge does make a good point though about the law. Just because something like masks is absolutely necessary to keep hundreds of thousands of people from dying and millions from getting sick doesn't necessarily mean the CDC is the governmental entity with the authority to issue a nationwide mandate.
Looks like the judge purposely missed the last part of the statute at least assuming the Surgeon General issued the order with the CDC. From Section 361 of the 1944 Public Health Service Act. It seems to me the "and Other Measures" would include a mask mandate.
The Surgeon General,[44] with the approval of the Secretary, is authorized to make and
enforce such regulations as in his judgment are necessary to prevent the introduction,
transmission, or spread of communicable diseases from foreign countries into the States or
possessions, or from one State or possession into any other State or possession. For
purposes of carrying out and enforcing such regulations, the Surgeon General may provide
for such inspection, fumigation, disinfection, sanitation, pest extermination, destruction of
animals or articles found to be so infected or contaminated as to be sources of dangerous
infection to human beings,
and other measures, as in his judgment may be necessary.45