I can totally understand the need to protect your citizens, but I rather think that this kind of behaviour damages the reputation of the US deeply. In the long run, you might have gotten your hands on someone's data that would like to harm the US (but are these guys so stupid to put their malicious plans on a handheld device they use at border crossing?)
Actually after the Snowden revelations: aren't the three letter agencies able to access our data without us knowing it anyways? If we are on their radar, they can get whatever info they want from us anyway. That's my understanding. So why harrass the normal person crossing the border?