It's sad this is the default view. It's his device, his data, his life on that phone. If he had wiped the phone before the interrogation it wouldn't be a problem. How long before? A second before? A week before? But wiping the data a minute later is suddenly asking for trouble.
If you're going to be in a situation where you're in a room with some goons backed by the full power of the state, it is what it is.
Maybe because I'm not American I don't have any hangups about seeing the US government this way, but my own government is no different - you can (and people have) get stopped at Heathrow, taken to a dimly lit backroom and given a going over for hours
Edit: a bigger picture question is the difference between things that may be legally punishable and things that may cause suspicion from CBP agents, which aren't the same thing at all.
A non-citizen who arrives with a blank phone might be denied entry because it seems suspicious.
Note that if you're not a citizen of the USA, refusing to comply with a request like this is very likely to have you sent back to your country and denied access to the USA forever. While they can't legally force you to comply, they can absolutely deny you entry for any reason like this, regardless of having a valid visa and everything else in order. This even applies to legal residents.
If they can't compel you to enter a password (courts have ruled passwords are 'speech' and the government can't compel or constrain speech, absent some well-defined grounds for doing so. There IS law around spoliation of evidence but AFAIK this requires a judge issuing an order. Of course, suddenly taking actions you wouldn't otherwise have on learning you're under suspicion could be claimed by a prosecutor in court as circumstantial evidence of guilt but it's not a cause of action in the first place until you're notified by a court to preserve evidence. Can a prosecutor try to construct a theory that the alleged actions do amount to obstruction? They can try but it's a serious long shot. I think this is a case of this administration directing the justice department to bring yet another dubious, likely-to-lose case as an extremely aggressive way to make a point by trying to assert and establish rights they don't actually have. So far, their track record in such cases hasn't been good.
> Note that if you're not a citizen of the USA
Yes, everything is different in this context if you're not a U.S. citizen. The U.S. govt can deny entry to non-citizens essentially without justification. I think this sucks as it goes against long-held American ideals around presumption of innocence, consistent treatment under the law, standards of evidence and having cause, but it's not currently prohibited.
Note that I'm not talking about a situation where they have you in custody or are about to, but haven't (yet) removed your phone for whatever reason, and you quickly take some action to clear it. I'm talking about a situation where they are questioning you, and in the course of questioning, request that you unlock your phone for them to inspect, you agree to do so, and proceed to wipe the phone or enter a dummy password for a fake account while pretending that you are complying with the request.
It is this second situation that happened in the article - the man being charged was held in custody and repeatedly asked to unlock the phone or risk having it seized; the man finally agreed to unlock it and provided a passcode to the officers, but the passcode instead wiped the phone.
People have been doing this since way back in the TrueCrypt days - IIRC you could configure it to run a whole fake version of Windows if you wanted without easily revealing your actual main volume.
Most hardware crypto wallets also have a "duress wallet" feature where you keep a low balance for the same reason.
Wiping is obviously extremely suspicious and asking for trouble