The worlds second oldest profession, like war, is one that is grudgingly accepted by many and denounced by some/a few. There are examples of espionage though that even the staunchest ethicist would at the very least have to reluctantly accept. Where an acceptable war is never better than the lesser of two evils, there are instances where espionage has been a near total replacement for evil.
1960 U2 incident. The Eisenhower administration wanted to monitor soviet military developments with their new fangled high altitude plane, which managed to get shot down. At the time, Eisenhower wanted to do a trade of sorts with the soviets in which either side could do flyovers for monitoring purposes. The Soviets refused, leading to the U2 debacle. With the later advent of satellites this discussion lost importance.
The task here was monitoring; making sure the other side was keeping to their commitments. Partial Test Ban Treaty, Nuclear Non Proliferation Treaty, SALT I, II, Detente. Both sides wanting to avoid an all-out arms race, but needing to keep pulse on the other.
A senior US administrator (whose name eludes me, president?) once jokingly remarked that in the vein of clandestine monitoring, both the USA and Soviet Union would be better served by simply swapping heads of intelligence.
In summary, during the Cold War, intelligence monitoring played a huge role in keeping things kosher. Intelligence was really no more than mutual policing. Like there are laws and police, similarly there are treaties and spies.