It was constitutionally motivated. It's kinda their job. To make sure that elected officials obey the law and comply with the constitution. Look, a couple of things here...
One, it seems that some of these gang members are really bad dudes. They deserve to be punished for any crimes that they have done and then deported. Or deport them to somewhere where they'll serve a sentence. I've got no problem with that.
Two, the judge hasn't said that you can't deport these guys. I'm pretty certain that he'd agree that they need to be. But he's said that you can't do it in the manner that Trump had decreed. There needs to be due process.
Three, if these guys are as bad as is being said, then there are plenty of options to deal with them using due process. Using the particular act that Trump is trying to do is skipping that due process. And as bad as some of these guys might be, dealing drugs to kids, rapists, murderers, then due process is still required. I don't want to live in a country when it's not automatic and I guess that you don't either.
Four, can everyone please drop the inane 'theses judges are not elected' line. They are either nominated (unelected) or they are elected. And do you honestly think that someone who is elected by a majority of Democrats is not going to have some bias against Republicans? Or vice versa? And hey, I didn't hear any complaints about these unelected people being placed into positions when they can decide cases against the government when there were three 'conservative' judges nominated to the SC. So please...just stop.