The reason why this can set a dangerous precedent, as it would allow law enforcement to force a company to create code (in violation of the 13th amendment) to meed the demands of law enforcement. If this very act is allowed, then it becomes possible for the government to easily request that other code be made, e.g., pushing an update to an IOT device to activate its microphone and spy on you, or forcing a company to add an option to remotely tap into a phone's camera or microphone.
The government does many secret orders which do not set a precedent, but in a public case like this, it will, at which point, it can be used in more secretive court orders to add additional spying capability.
Also understand that encryption on modern systems no longer relies on secret algorithms to encrypt data, they instead rely on an understanding that everyone knows exactly how it works, and thus the most efficient way to crack it, and still have that process take an excessively long time. Anything that weakens the time aspect, is a back door, as that is the encryption's only line of defense.
If you wanted, you could teach a toddler to crack AES 256 successfully, it is well known to that extent, but even with complete knowledge of it, it doesn't make it any faster to crack when implemented properly.
hat the government wants in the case of apple, is to cripple the implementation of it. Furthermore such a ruling will cripple the ability for cellphone makers to further improve the security of their devices as they will have to maintain the ability for the government to gain access to the devices.