Judicial review has upheld the constitutionality of affirmative action policies for 40+ years, what changed is the composition of the Supreme Court and its related willingness to legislate from the bench -- abandoning stare decisis and judicial restraint.
We saw this with Roe last year.