Ever wondered about programmers working for example for all the social media companies tearing our society apart?
They sleep just fine. Probably because they believe they do just a small part that's not harmful by itself and if they were not doing it it would be someone else.