> Only if you're accused of a crime, right?
Not really. As soon as you know there's an investigation against you, any action to purposely destroy relevant evidence can be used against you, even if there was no formal crime charge yet. For companies, they usually get special letter that instructs them to preserve evidence due to investigation ongoing or lawsuit pending. It is also common in civil cases, where there's no crime to talk about at all.
But on a personal level CBP agent saying "we need information on your phone" can be treated as informing you about necessity to preserve evidence, and they may as well just give you a printed instruction saying you have to preserve it. Once they did that, purposely destroying evidence (which is anything they could consider relevant) is a crime.
Unfortunately, you are not likely to get off on technicality with this - they know the technicalities much better than you. The whole policy of border being "rights-free zone" needs change, not finding a loophole.