As I said, there are reasonable answers, and I'm ignorant of your life, but if you want my view: you should not be part of that system, not because I disagree with it, but because it's wrong. I acknowledge that I may be wrong to think so. "Oh, you think so?" is a distraction from any actual points at issue.
If you've pushed back against particular acts of snooping, then thank you for that. I did not know you're personally involved in particular acts; that's a different moral question than writing an automated system. Note that "better you have ME" is what you'd expect Nazi collaborators to say. You're not a Nazi collaborator, but it shows the at-best ambiguous advantages of this sort of involvement.
Most people trust their own judgement. According to Dunning/Kruger that's weak evidence of a problem rather than positive evidence you're doing good.
In Feynman's autobio he said he regretted keeping at work on the bomb after the Nazis went down. They were all so invested by that point it didn't even occur to them to quit. IIRC that was part of why he chose to turn down work for the feds in general over the rest of his career.