They weren't thinking - they voted for him precisely because of shit like this. They see him as endlessly entertaining, are convinced that nothing bad will ever happen to them because of anything Trump does, and love that he upsets other people (thinking people - or as they call them, snobs) so much, especially liberals with college degrees. "Look at all those people getting red-faced over him threatening to just take Greenland or the Panama Canal! Ha ha! All those snooty liberals losing their minds over this. Oh, I'm loving this!" He's "blowing up the system", "turning over the applecart", "disrupting the status quo" or whatever the hell they want to call it.
The fact that he's also causing very real damage to our relationships with our allies and doing the bidding of people like Putin doesn't bother them in the least, or matter to them at all. He's fun, he's entertaining, he hates the people they hate and makes them mad, and so they love it and want it to continue. Until, that is, his bullshit and idiocy and antics gets us into a war or causes a (at minimum) severe recession or leads to lots of Americans getting killed here or abroad, or something he does starts to affect them personally. But even that won't change their minds - they'll just somehow still blame Democrats and liberals and their usual suspects rather than Dear Leader (or themselves for voting for him).