Some things need that, some don’t.
Doesn’t matter anyway, Uncle Sam voted themselves the right to demand your unencryption passwords if you ever cross a border, at will, and no due process or 4th Amendment rights for Citizens.
If you don’t comply and they know you have something encrypted that they want to see, they can detain you indefinitely under the terrorism laws and hide your court case from public view under FISA.
So I'll pick nits here. It's more subtle than you've described.
It isn't a "voted right" on their part. It is however, adopted DHS/CBP policy. Congress had not reigned them in, and the courts have said you have no right to privacy.
Technically, if you are a citizen, the CBP policy gives them the right to demand passwords from you at the border for any application installed on your computer. They are NOT supposed (under the policy) to permit that computer to be connected to the internet or demand any password for stuff that's not on the computer. YOU can be detained only for a short period of time (not "indefinitely"), and as a US citizen, they must admit you to the country. Courts have held that you have a First Amendment right to not disclose the passwords (but your fingerprint or retina scans are not so protected). Should you exercise that First Amendment right, they can detain the device indefinitely, copy the device storage, and turn it over to other agencies to try and decrypt/extract information.
Policy document here:
https://www.cbp.gov/sites/default/f...rder-Search-of-Electronic-Media-Compliant.pdf
That's the policy. In practice, though, some agents may elect to violate that policy, and potentially "disappear" you. Not smart on their part, but they do usually manage to get compliance. They can also revoke any "trusted traveler" designation you have, and could potentially put you on a watch list or DNF list, thereby making your life miserable.
If you are NOT a US citizen, none of the above holds, and they can deny you entry to the country.
Other countries, the authorities can demand your passwords to online and offline stuff & arrest you if you don't comply. The UK comes to mind.
All of that is one big reason that a growing number of companies and individuals take "loaner" computers & phones on international travel and provide end-to-end encrypted cloud services for data that must be used. Some even instruct travelers to securely "wipe" data and apps from their computers before re-entering the US. So if the equipment gets searched or seized the information is not on the device (and they can discard the device if they ever get it back). (other reasons for loaners include potential theft, industrial espionage, and ensuring compliance with ITAR and technology transfer laws). Data that crosses borders is likely to be sucked up by the big NSA vacuum that taps international communication - using end-end encryption makes it harder to decode (in which case NSA stores it until they can find a way to break the code).
And very few Citizens seem to care. Or even stupider, want it that way.
"If you're not doing anything wrong, you have nothing to hide". "out of an abundance of caution". Sigh.