Trumps hand was forced because several conservative AGs is red states were suing the federal government because Obama's executive order was supposedly unconstitutional. Rather than fight AGs elected by his base, and look bad, he gave in. His own AG was for a reversal anyway, and he could send him out to be the one to take the spotlight for it, even though everyone blames Trump anyway.

But this is what you get when you play to a base of red meat addicted rabid dogs. 

And to think, he could have had legislation ready to go. He could have said, "Let's handle this border and immigration situation, pass the Dream Act and fund my border wall." He doesn't even know how to use basic leverage appropriately.