the Doctor was sometimes sent on missions by the Time Lords, especially by the Celestial Intervention Agency, which makes him a kind of spy.
Sara Kingdom (and other characters from the same TV story) was a companion of the Doctor who worked as a James Bond-type secret agent for the Space Security Service.
Vislor Turlough was planted with the Doctor by the Black Guardian to spy on and then assassinate him. Another companion, Kamelion, came under the control of the Doctor's arch-enemy the Master. Either of them could be called spies.
There have been various stories about wars or political intrigue that featured someone acting as a spy for the other side.
If you're more specific about what exactly you mean by "spy", I can give you a more specific answer.