Government prosecutors knew even before the trial started that she was not a spy, but they (U.S. Attorney) refused to back away.  There are several good books dealing with the farce, including one written by Ronald Radosh.