It’s a very “Mother Night” kind of question. Vonnegut’s moral wasn’t an especially deep one, either. We are what we pretend to be so we must be careful what we pretend to be.
I’m still going with my original response, which is/was about the morality of actions, rather than the person.
In a pure binary system, an evil act pure and simple. But then again, binary systems are rather boring and overly reductive.
In a spectrum of evil acts, it’s one which is marginally better but still well on the evil half.
In judging the act, I personally don’t think it matters much if the person is a spy, a true believer, or anything in-between. The act itself is marginally less evil but it’s still overall a horrendous thing to do. As with my previous beer analogy: still evil, less filling.
If you care if the person is a spy or whatever, instead of judging this one decision, you’re really just punting the ball down the way. You would then need to add some kind of ‘running tally’ which measures not just the individual action but the collective actions through a campaign, war, or lifetime. Is the sum total of actions this person took a net good or a net evil, i.e. does the collective good the spying did make up for this person’s actions? Even in this case, while it’s possible it makes a difference, it’s difficult to see how a marginally less evil act in this one case would really be the deciding factor on a good vs evil scale over the course of a war. And arguably in this case, you’d still have to balance the additional and very real risk of detection (and corresponding harm to the overall war effort) to the marginal reduction in evil done.
ETA: Should add, the idea of a spy is a valid one. But the whole point of undercover operatives is they must sometimes commit questionable acts or crimes for the greater good as above. That doesn’t make the crime itself any less evil but it does provide at least some rational justification in the long run.