> Of all the issues with the US justice system, being compelled to disclose passwords isn't one of them.
This is not totally true. It is also a US issue: CBP has been asking for passwords (or to unlock the device) for phones and computers for more than a year now. Last year, multiple people got turned around because they disagreed with US policies and political views that differ from those of the US's current president.
I don't approve of CBP's approach here, but being denied entry to the country isn't punishment, even if it might feel like it at the time. And that only applies to non-citizens, where entry is fairly reasonably at the government's discretion. Citizens must be admitted regardless.
Rules at the border tend to be pretty restrictive almost everywhere. You can literally get in trouble for having a sandwich in your bag. I'd wager Hong Kong border control was also empowered to request phone passwords and turn away refusers long before this change.
> Last year, multiple people got turned around because they disagreed with US policies and political views
so they were not in US technically?
You don't have the protections of U.S. law at the border.
CBP is also asking, not compelling. You don't have to give them your password. If you don't, and you're a foreigner, you may be turned away. If you're a citizen, and I remember correctly, they can seize your device for up to two days if they want.
But they're not going to put you in prison for refusing like the U.K. and Hong Kong will.