I like the option better of spying on your allies while defending them from other nations' spies. Let me put two spies in an ally's territory, and I'm not only protecting my interests from the enemy, but protecting myself from my allies.
It would also alleviate some of the concerns if your ally takes a territory in which you have an active spy, if that spy had the option to become a defensive spy rather than being a potential problem further on. If your ally takes a territory, and then five days later puts their own defensive spy in there, which then reveals your offensive spy...
I think the game should default to your spies being defensive in allied territory, with the option to make them offensive if needed.
If you are in a team game you can place defense spies in your allied territory.
Concerning outside team games. its tricky because players can turn on each other at any moment. its possible to add in but its going to be some work because you need to add in more text in newspaper and spy reports. Its not out of the realm of possibility.