They are required by law to do the latter. They are not required to to do the former (or at least are willing to go to court to defend that belief).
> They also don't allow users to encrypt data stored in iCloud
The article you linked does not back up this assertion. It says they chose not to automatically encrypt user backups to the cloud, at the FBI's request. I'm sure if you encrypt data and upload it to iCloud, they will not delete your encrypted data.
It would be the responsibility of the iCloud service to encrypt data (if Apple had chosen to do so, and a user opts in). Simply choosing not to delete encrypted blobs is not the same thing. The salient point is that Apple was _going_ to offer encryption as a part of the iCloud service, but dropped the feature at the FBI's request.
Apple's front as a privacy company is little more than PR. I understand this isn't really the point of your comment, but I think the privacy policies of Apple and Mozilla make for a misleading comparison.
Mozilla cannot have anything other than a huge positional advantage over Apple where privacy is concerned, mainly because the amount and type of personal data the two companies ingest are so vastly different. Were Mozilla to adopt Apple's stance on privacy, results would be disastrous.
[0] https://www.apple.com/legal/transparency/us.html
[1] https://www.reuters.com/article/us-apple-fbi-icloud-exclusiv...