The logic traces back to early 2017, when Trump issued his first ban covering seven Muslim-majority countries.