Actually, its a differentiation that most journalist and editors fail to make primarily because their publications sell better using the term "spy" instead of "(case) officer" for the intelligence agency employee and "agent" or "asset" for the actual spy that is being run.
Unfortunately, that disservice has existed for decades and is probably difficult if not impossible to break.
The diplomatic immunity is what mattered in this case. If it was someone with American citizenship but no other special status it probably would have gone differently.
Unfortunately, that disservice has existed for decades and is probably difficult if not impossible to break.