Your problem probably possibly can be solved this way. I've also had those clicks while recording through SPDIF. The solution was to set my recording device clock to SPDIF, instead of internal, ADAT, or whatever.
The noises I've been complaining aren't just clicks. The whole sound gets messy, specially the low end, which gets completely noisy, but only when I the guitar through any of the inputs. If I connect my guitar straight to my recording device, running through SPDIF, it sounds ok.