I think you're conflating two very different things. You're completely right that the government can make pretty much whatever they want illegal, but things are legal unless expressly made illegal. Erasing your phone wouldn't be illegal because it implies guilt, but because of obstruction/destruction laws explicitly criminalize such things.

The whole case is going to come down to the nuanced and often contradictory interpretations of border law exceptions. I also don't agree that these sort of protections are for e.g. robbers, because of the criminal underground's $5 in-person data hacking tool. [1]

[1] - https://xkcd.com/538/