A hearing to decide whether to hold Sheriff Joe Arpaio in contempt of court for violating court orders in a racial-profiling case took a surprising turn when the lawman acknowledged that his office was behind a secret investigation into the judge's wife.