Re: "necessary or appropriate"
Actually, if you read the order:
https://www.documentcloud.org/documents/1372280-apple-oakland.html
it's fairly clear that Apple is being ordered to assist the government in the execution of a warrant. So the government did go through the correct procedures. As a third party with the potential to provide assistance in execution of the warrant, Apple is an appropriate target for the write. But note well that Apple's cooperation is limited to any potential capability that they have of a) extracting the encrypted data and providing a copy of the encrypted data to the government or b) bypassing the lock code. If Apple doesn't have the ability to do (b), they can do (a) and then the government may attempt a brute-force attack on that data.
I don't see problem here. And the "All Writs Act" is a good reason for Apple to implement one-way encryption that can only be undone by the users passphrase OR brute force.