I believe the last spies executed in the US were the Rosenburgs back in the 1950s.
I believe that the US still tries and executes spies but we just don’t hear about it anymore. Hate to say but it would make sense especially if simply revealing the name of the spy exposes US intelligence assets. Better to deal with them in secret.