Surely Ted believed what he was doing was a great good
https://www.bbc.com/news/world-us-canada-65867291
In his own journals he wrote that he didn't claim to be "altruist or to be acting for the 'good' (whatever that is) of the human race", instead insisting that he acted "merely from a desire for revenge".