Some things are not obvious to some people.
The issue is not whether the "decision" to surrender the code is "obvious" or not.
The issue is whether or not the state can compel you to -- or be subject to contempt of court or obstruction charges.
The underlying issue is whether or not it's required that a suspect assist the police in their investigation. Constitutionally, the right against self incrimination is normally straight forward. In the case of having the only information needed to unlock a device, it's not as straight forward. Hence the need for a SCOTUS interpretation.
When the Constitution was created, and again when the 5th Amendment was added, the only way of having information to assist police in finding evidence was if you knew where it was physically hidden -- e.g. the murder weapon was thrown over a bridge or hidden in a barn.
Today it's much more complicated. The things contained on a phone could implicate you in other crimes -- e.g.
We didn't find the emails we wanted, but there are photos placing him at the scene of another murder. There may also be evidence on the device which, if access to it is given to the police, creates a question of chain of custody. E.g. If the police used excessive force and it was caught on video on the suspect's phone, why would the Cops not erase it? Better yet, if the phone shows a text message that proves the suspect's story was true, a Cop could delete that text as it might prove to be exculpatory.
Bad Cops in the past have planted evidence and ignored exculpatory witness accounts or alibis when the suspect is a known criminal who the Cop just wants to get off the streets. If he didn't do that crime, he's gotten away with things at least as bad is their rationale. Never mind they are leaving the real perp on the street.
So, while most Cops are honest, presenting any of them with the opportunity to delete something they don't like is too great a temptation to risk one's freedom on.