Let them have the password
OK, so I'm a terrorist/pedophile/drug dealer/critic of the current administration with a normal (or higher) IQ who wants to get into the US and commit a dastardly deed. Months before I leave, I purchase a second phone and a micro SD card. I use that second phone (but never put the micro SD card in it) in a normal, boring way using separate social media accounts. My phone has pictures of my family, buds, and I doing normal, boring things and records the normal, boring social media participation.
I put all my terrorist plot materials and child porn in an encrypted file on the micro SD card then encrypt the whole card and I conceal it somewhere in my baggage or, if I think my baggage will be searched so thoroughly it might be found, swallow it and get it out of my shit later. Alternatively. I would send it to an associate/sympathizer, perhaps via multiple third parties. I then take only this second phone with the dull, boring stuff on it and go to the US. I cheerfully give the phone to the border cop who finds nothing of interest on it and waves me through. I then get the micro SD card from my "friend" and do the dastardly deed after which I immediately wipe the phone.
If sending a micro SD card is too likely to be caught, I simply take my dull, boring second phone with me, install Telegram, Signal, or such from the app store /after/ I'm in the country, and retrieve the encrypted file through that, (or SFTP it from the server at Terrorists R Us), do the dastardly deed, and immediately wipe the phone.
For a domestic miscreant, follow a similar pattern and access the damning data in the cloud using end-to-end encryption then immediately wipe the phone.
For bonus points, replace the deviant data with something that looks plausible but leads the LEOs on a wild goose chase.
Any would-be miscreant who is stupid enough to have the real contraband data on their phone when they enter the country or might get caught in-country qualifies for the Dumb Criminal of the Month award and is fair game for the LEOs.
There are probably race conditions in the scenario or corner cases where this might not work, but the point is that a truly-determined criminal will be prepared enough to find an alternate way of getting at their incriminating data other than leaving it on their phone.