The purpose of the right against self-incrimination is to prevent forced confessions and torture. With that in mind, it makes sense to draw a line between compelling someone to provide their fingerprint or DNA and forcing someone to divulge something they know. When the state has the right to make someone talk, how does it go about it? Also, it's impossible to know whether someone actually knows the passcode to a device, so someone could end up imprisoned indefinitely just for forgetting a password.
Once they can read minds, what then? And this isn't just science fiction; I've read reports that a persons inner monologue is soon to be accessible because when you talk in your head, it causes ever so slight commands to be sent to the voice box, which in turn reacts slightly. Not enough to produce sound or even be noticeable to a person, but which technology is being developed to pick up on.
How does this not apply here?