A judge has described the "stain" on a doctor's character as he was sentenced for taking intimate images of patients and colleagues at a major NSW hospital.