I don't think you can. They are there for the duration. Think of them as not just a spy, but a network of spies with equipment, money, etc. Just like a diplomat, which opens an embassy for you.
I took the spy routines from the design done in the eighties but maybe never used. Don't know. Routines were there but not active when I got the code from Randy in the late 90's. Originally there was a spy ship that you recruited insurgents on your own worlds, loaded on the spy ship, and landed on a planet, similar to guerrillas. They fought other insurgents on the world for control of the spy network although to what end I don't know as I have not found any end game. They reported things happening on the planet again similar to smuggling centers. I thought spies should be more proactive than just sitting around waiting for something to happen on the planet and then report it so came up with actions you could send them to get some info. I never really considered anyone wishing to withdraw a spy from a planet. I suppose I could use the old spy ship and routines and have it withdraw the spy from a planet.
Suppose you conquer a planet and it is now in your possession. What do you with a spy on a planet you own? You can't deploy the spy elsewhere and it just sit there reporting on a planet you now own. How about letting the spy be "extracted"? Maybe it was not the original design intent, but I think of spy with Takamo as today's SpecOps being inserted/extracted via a submarine; just a suggestion for the future.
Well, at least no one else can drop one on that planet. I would leave him there. He's like one of those Japanese soldiers from WW2 who doesnt know the war ended decades ago.