The former approach means you can’t do anything with clear conscience: do you take that vacation or donate the money? Do you punish yourself if your work on databases eventually was used for a scam?
I find it paralyzing to operate in the former way: so I take the traditional stem person approach. I just ensure what I do is good (obviously for the highest bidder). I won’t work for an explicitly criminal organization - but as long as the government approves, am in. I am going to let them do the policy making and governing because frankly I am tired and probably incompetent at that since I don’t sink much time thinking about it.