There are two reasons for this: Voters already behind Trump want the wall, and political effects of shutdowns usually fade quickly after shutdowns are resolved. That this shutdown occurs nearly two years before the next election merely adds to the fact this is probably a good gamble by Trump.
Polls have long shown that controlling immigration is a high priority for Republican and Trump voters. Indeed, the midterm exit polls showed that immigration was the second-most-important issue facing the country, and voters who thought it was the most important voted Republican by a 3-to-1 margin.
Republicans also overwhelmingly support building the wall. The most recent Quinnipiac poll showed that 43 percent of Americans supported building the wall, including 86 percent of Republicans and 45 percent of independents. The same poll found that 52 percent of Republicans think immigration should be the top issue for Congress in the coming year.