All writs act
The issue in the NY judgement is simply that the FBI have presented an interpretation of the all writs act which permits them to require a third party to do anything that they want as long as the purpose of the action is to aid the FBI in their statutory duty. The magistrate has quite correctly responded by saying that if that is the correct interpretation of the all writs act then the all writs act is unconstitutional and therefore the courts should take a different interpretation or simply refuse on the basis that the all writs act is invalid.
It is that alternative interpretation that is rather difficult. Can you define a general scope definition for permitted writs that includes what the FBI is asking of Apple but excludes outrageous requirements like "Microsoft, we require a complete computer forensics package, please write one for us and hand it over (free of charge)". If the FBI wants to win then they will need to produce a formal justification why the software development work requested is a reasonable request and quite different from my outrageous suggestion above.
The key difference between this and a normal search warrant or subpoena is that it is a request to "do some work" rather than hand over some material evidence.