It's appalling that law enforcement types are having to get a court order to compel Apple to do this. A severe crime has been committed, and it should be a privilege for a company like Apple to help the investigation. Instead Apple seems to want to obstruct it.
I wonder how obstructive they'd be if someone that Tim Cook was very fond of had been killed in the attack?
Sooner or later companies like Apple, Facebook, etc are going to have to realise that their public image and reputation will ultimately depend on cooperation with law enforcement. For example, Facebook are now known as having hosted child porn without having done anything about it. That can't be something a certain new father called Zuckerberg is happy about.
How big does a content hosting organisation like Facebook have to be for it to be able to avoid criminal responsibility for hosting such material? It would be crazy if no one at Facebook was prosecuted.
Presumably Apple with their encrypted iCloud are probably hosting such material too, but have no way of knowing. That may change now. If they are forced to develop this tool for law enforcement it may be that they're going to be regularly exposed as having given offenders the means of committing their crimes. Now that's not going to look good in the papers.