Why were attempts by Congress to regulate child labor and fa…

Why were attempts by Congress to regulate child labor and factory conditions in local workplaces struck down by the Supreme Court as unconstitutional in the late nineteenth century (late 1800s)?  Note:  FDR and Congress, with New Deal legislation, successfully created laws which prohibited child labor and improved safety conditions