Intent matters. It might be hard to prove, but it matters.
It may not even be that hard; what other possible explanation is there for someone putting a PIN visible on their phone that wipes it while crossing a border?
Two obvious answers:
1. It's for the general case of lost/stolen phone.
2. It's for the owner. I can't remember numbers I don't type in, might as well keep it visible on the device.
theyll have a hard time showing that you intended for the government to break the law. first the government would have to admit breaking the law
For thieves, obviously.
"I told you not to. You're the ones who wiped my phone. You owe me money for destroying my personal property."
I'm not saying you would get a check courtesy of Uncle Sam for your troubles, but the argument that you deceived authorities into destroying evidence is a lot weaker.
I might go with "do not enter 696969" instead because the stranger fiddling with your phone probably expects a your phone to do something funny, like load a shock site.
At some point, we have to accept that the world has irrevocably changed, that people have lived where they live for generations, that resettling them all is impractical, inhumane and just not a good idea in general, and just move on and build the best world for the people currently here.
During WW1 and then again during WW2, the world has agreed to the right of self-determination. If people feel they're a certain nationality separate from what their government imposes on them, then they have a right to become their own country with their own laws and their own border enforcement. If you are literally asking what gives Americans the right to prevent others from coming, this is it.
I suppose it's possible someone might enter it without thinking, but the odds seem low. Also seems risky to put a self-destruct PIN on your device, lest a friend (or enemy) enter it by accident or as a prank.