Declaring a national emergency to build a wall on the southern border is wildly unpopular. Polls have consistently shown that about 66% of Americans think that Trump should not declare a national emergency to build the wall, and only 31% think that he should.
So why would a president up for reelection double down on such an unpopular policy?
The answer is the Electoral College. The president does not need a majority of Americans to like what he is doing. All he needs to do is to turn out his base and win by a slim plurality in the few swing states that will decide the election.
If, on the other hand, the president needed to win the most votes from across the whole country, it would be unthinkable for Trump or any other president to chart a course that two-thirds of the nation opposed.