I am really curious: What is the reasoning to allow this to happen to US citizens?
However, CBP does not have the right to demand that you give up your passwords as a citizen. They can attempt to coerce you through detention (but if that detainment were prolonged you'd have a solid habeas corpus case).
[0] https://www.eff.org/wp/defending-privacy-us-border-guide-tra...