i can't remember the exact argument the democrats tried to use with the travel ban, but it was instantly clear that trying to get it struck down because it was discriminatory against muslims was a bad legal argument, and wasn't going to work. i've been through this on this page a couple of times in the last few years; it's up there. was it early 2017? everything's dated.
there were two better arguments. the best argument would be to show that it wasn't a rational means to carry out the policy objective. in order to do that, you'd have to concede that the president would have the right to ban muslims if he really thought it was a national security issue (which, frankly, is not actually even controversial - of course he would), but rather show that a blanket travel ban wasn't going to actually work. broadly speaking, the president has almost no check on his authority in terms of what he decides is valid policy. the courts really have no jurisdiction in setting policy. what the courts can do is step in and declare that a specific action is or is not a rational means to actualize an actual policy. and, i'd like to see the administration argue that a blanket travel ban from iran is going to eliminate a terrorist threat that broadly doesn't even exist.
the other argument is that it was overly broad. again: you would have to concede the presidential right to ban muslims, but then argue that non-muslims would get stuck in a blanket travel ban, and the law should be struck down for that reason. and, i know that people aren't going to like it, but the actual fact is that it's the superior legal argument. that would have actually worked.
but, the reaction was never legal, it was always political; the arguments presented to the court were never serious legal arguments, and never had a serious chance. i have no training in american law, and i could very easily disassemble them as without merit. these arguments were meant to run on talk shows, and to generate rallies, not to win an actual case in an actual court.