This is not a simple issue, cut and dried. In the first place, one wonders why the government ever made public its inability to crack the encryption of the phone. The wiser course of action would have been to have let the terrorists believe the phone was yielding mounds of important information. Maybe ISIS would have figured it was a bluff; maybe not; but better to plant seeds of doubt in your enemy's mind than to let him know his secrets are secure. Or perhaps they should not even have mentioned the phone - again, it can throw an enemy for a loop if he doesn't know what you do know about his plans.
Second, the government should have asked for Apple's help quietly and behind the scenes. Perhaps turned the phone over to them, asked them to open it and then taken it back once the task was accomplished. This would have removed questions of public pressure and might have allowed the code to be broken, which is all the government should have wanted, anyway; to find out if the terrorist had been in contact with others and had been involved in any other potential plots. The constitutional questions are important, perhaps central, but are not the immediate concern here. Protecting Americans from future attacks is. Better to do that than to be distracted by weightier but less immediate matters.