He was the West’s most important undercover spy. An affair brought it all down.