Actually what happened here was a deal was struck. What the Govt. was interested in even more than sending Hanssen to prison was finding out exactly "what" he compromised. Killing Hanssen wouldn't accomplish that. Apparently the deal was he would live, wifey keeps the house/pension, and he tells all.
Also, while he was actively spying for both the U.S. and Russia, he "gave up" two Soviet spies (working for the U.S.) to Russia who were then executed.