The court can provide permission for officers to violate the law. A good example of this is allowing an undercover cop to participate in illegal activities and if still under cover, lie under oath. This is all pre-supposed to be in service of a larger public goal.
I assume that in this case, the court felt that there was compelling public interest in having these infected servers remediated and low harm to the owners. This is my understanding, anyway, IANAL.