SCOTUS ruled that Obama's EO was the illegal action. If Congress passes legislation that legalizes DACA, that's a horse of a different color.
SCOTUS has never ruled on DACA or it’s now defunct cousin DAPA. DAPA was struck down by the 5th Circuit in U.S. v. Texas, but SCOTUS was a 4-4 tie with no opinion so we don’t have a clear ruling. The only DACA case to get to the Court of Appeals level was Johnson v. Crane, where the same 5th Circuit found that Mississippi hadn’t established standing to sue. So there was never a ruling on the merits.
However, with the ascension of Gorsuch to SCOTUS and if DACA was ever presented for a ruling, I believe the rationale in the 5th Circuit rationale in U. S. v. Texas would find five votes in agreement.