This is a creepy story, and a troubling result. Bottom line, the court likened a passcode to a strongbox key. Reasoning, if you can be compelled by a court to turn over a strongbox key, you can be compelled to turn over your passcode.
I feel a tide turning here. This case will likely end up in front of the Supreme Court.