Sure, but the legal precedent will make this a rubber stamp in future, and will mean that Apple can't reasonably resist such orders from other governments.
In the future, Apple could make a phone that is actually secure. For example, requiring the phone to be unlocked before updating firmware.
The only restriction on this law that Apple could claim (aside from legally out-there options like equating writing software to forced speech) is "unreasonable burden," but this is something that almost any of us could hack up in a day given access to Apple's release build system.