There are two possible approaches to explaining odd things Trump does. One is to assume that he is stupid, crazy, erratic. Early in the campaign that looked like a plausible explanation. After he won twice contests everyone expected him to lose, first the nomination and then the election, it was still possible–he could have been lucky–but less plausible.
The alternative is that he is crazy like a fox, doing odd things for reasonable, perhaps tactically correct, reasons. I am not sure that is what is going on but I think it quite likely and have been trying to make sense of his moves on that basis.
The most recent example, not done directly by Trump, was preventing Elizabeth Warren from speaking against Sessions on the grounds that one senator was not supposed to say hostile things about another. That got a lot of negative publicity and was widely viewed as a blunder.
There is another possibility. The incident raised Warren's visibility and status within the Democratic party. That will tend to pull the party left. Trump may well believe that pulling the Democrats left will make it harder for them to win future elections. He may well be right.
Apply the same approach to making sense of the apparently bungled executive order on immigration. Including green card holders in the initial order made no sense in terms of the stated objective and was a considerable, and highly public, nuisance for those affected. The result was a lot of hostile criticism, greatly increasing the amount of publicity the executive order got.
Seen from the standpoint of Trump's base, he was doing something about immigration and terrorism, as he had promised and it must be a substantial something if his enemies in the media were so upset about it. As Jack Goldsmith, a former head of the Justice Department’s Office of Legal
Counsel and a Harvard
Law School professor, put it:
would get a huge
symbolic boost with his base while not violating the law and
nothing of substance. He would get
value while doing nothing. Trump’s a genius at this.”