The main obstacle is that Korematsu is almost universally considered to have been wrongly decided. It is considered "anti-canon". Greene, The Anticanon, 125 Harv. L. Rev. 379 (2011)
Justice Scalia said that the ruling was wrong.
Justice Ginsberg wrote, "A Korematsu-type classification…will never again survive scrutiny." Adarand Constructors, Inc. v. Peña, 515 U.S. 200 (1995), (GINSBURG, J., dissenting)
Justice Alito has said, "We have, at times, overreacted in response to perceived characteristics of groups thought to be dangerous to our security or way of life and condemned individuals based on group membership." Fraise v. Terhune, 283 F.3d 506 (3d Cir. 2002)
Chief Justice Roberts was asked about this during his confirmation hearing:
Senator FEINGOLD. [...] Do you believe that Korematsu was wrongly decided?
Judge ROBERTS. It’s one of those cases that I don’t think it’s technically
been overruled yet, but I think it’s widely recognized as not
having precedential value. I do think the result in that case—
Korematsu was actually the—considered the exclusion and not the
actual detention, but the exclusion of individuals based on their
ethnic/racial background from vast areas. It’s hard for me to comprehend
the argument that that would be acceptable these days.
Senator FEINGOLD. It is often included, if you list decisions that
are sort of considered some of the worst decisions in the history of
the Supreme Court—
Judge ROBERTS. Yes.
To a similar question during her confirmation, Justice Sotomayor said, "It is
inconceivable to me today that a decision permitting the detention, arrest of an individual
solely on the basis of their race would be considered appropriate by our government."
Justice Breyer wrote in his book, Making Our Democracy Work,
"The decision has been so thoroughly discredited that it is hard to
conceive of any future court referring to it favorably or relying on
it."
During her confirmation hearing, Justice Kagan was asked for examples of cases that were poorly reasoned. She listed only one: Korematsu.
Thus, the main obstacle to such a law is that the judiciary seems to be almost universally convinced that Korematsu was decided incorrectly. However, Justice Scalia cautioned that these sentiments might be put aside again in times of war:
"In times of war, the laws fall silent. [...] That’s what happens. It
was wrong, but I would not be surprised to see it happen again — in
time of war. It’s no justification but it is the reality."
An alternative view, somewhat in line with Justice Scalia's outlook, is offered by Justice Jackson in his dissent in Korematsu. He recognizes that the courts might be pressed again to defer to military decision-making ("I would not lead people to rely on this Court for a review that seems to me wholly delusive") and proposes that the chief constraint against this unconstitutional action is the executive's "responsibility to the political judgments of their contemporaries and to the moral judgments of history." I take that to stand for the principle that it is up to the people to make it clear that such an order is unacceptable.