This is a perfect example of the “Exceptions” clause written into the requirements. Was there official request from their superior(s) for this info? Was there a valid complaint, evidence of wrongdoing? If not, accessing the info was NOT a part of their job, and the State should not be forced to defend their actions.
I think that one of the employees was acting on a request from their superior (or so it was claimed). I don’t remember anymore.