As a foreigner to the US I see this as a simple display of power: See how powerful we are over you, we can and will exert control over you, your data and your belongings. If you want to enter our Empire you will belong to us and will allow us to plug all your orifices.
No way I felt like that when travelling to the UK or to continental Europe.
The real answer is to avoid traveling there. Empires crumble when they become irrelevant. And for US citizens, they should definitely strive to create a society with more freedom and privacy for them. But only if they want that, which doesn't seem that way nowadays.