He was doing opposition research, of course.
And, as RememberTonyC says, it was real stupid of him. It’s like he wanted to get caught.