Why would it be illegal? They told you to put in your password, and you put in one of your passwords. If they want to fuck with technology and they're too stupid to understand it, that's their loss.
It's illegal because the primary function of the modern legal system is to protect the status quo powers. It's hard to outsmart a system when its whole purpose is to mitigate cleverness!
The best you can do is make the process as frictionless as possible for the border thugs, to get them to mislead themselves. For instance, imagine encrypted steganographic storage that seamlessly unlocks with a key retrieved from a remote server. If a GPS fix says you're in a dangerous area (eg border crossing), the server only unlocks the uninteresting bits [0]. A connection from your home network and/or designated third party is then required to switch the server's mode back to supplying full functionality.
And this needs to become the default mode of operation for a sizable chunk of phones, so that the "intent" bullshit becomes inapplicable. This is how the legal system works - you can only obtain safety through technical means en masse. Yes, we have a long hill to climb.
[0] Obviously this is trusting the phone and could be spoofed, but this isn't the threat model. The point is to make the behavior change passively.
Well, most likely because things like "obstruction of justice" are crimes.
I don't really get the notion that the law works like Airbud, where the rules have to be specific and anything not banned is permitted. It's totally possible to criminalize subjective things like "trying to trick us" which apply even if the means used are novel and not banned.
They aren't all too stupid to understand it, which would be why it would eventually be illegal to use such technology to deceive border patrol or other agents of the lawful government.