Do you believe this WP story?
Generally, I think it's probably accurate. This investigation was underway well before Obama was elected (even elected as Senator). It was only a matter of time until they (the spies) left the country, either because they recognized that they were compromised, or because of their own operation concerns.
Either way, once the Feds knew that some of them were planning on leaving, it was probably smart to snatch them up and trade them for something we wanted - our own spies back. I don't think Obama had any ulterior motive here, other than wanting to minimize the damage done to his beloved arms deal. The timing of this hurts him, not helps him.
Sometimes a spy story is just a spy story.