I think the last people who actually got executed for it was the Rosenbergs. Aldrich Ames just died in prison he served about 30 years he had leaked information to the Soviets that caused the deaths of multiple secret agents.
When there is no penalty there is no deterrence people can say that he got his penalty by serving the rest of his life in jail but the people who were found out because of him never had the rest of their lives.
He should have been given a last cigarette and shot.