... or beneficial to society, as well, I would say. Consider Hitler, who believed murdering 6 million Jews would offer a direct benefit to society. Also consider the Khmer Rouge, who believed murdering 5 million Cambodians would offer a direct benefit to society. Then there's ISIS, who thinking slaughtering infidels offers a direct benefit to society.
Actually, there's an interesting question there. Are such people immoral or merely ill-informed?
Perhaps you have read the great popular Christian apologist C.S. Lewis --- if not, you should. Here's what he had to say about witch-hunts:
Three hundred years ago people in England were putting witches to death. [...] But surely the reason we do not execute witches is that we do not believe there are such things. If we didif we really thought that there were people going about who had sold themselves to the devil and received supernatural powers from him in return and were using these powers to kill their neighbours or drive them mad or bring bad weather surely we would all agree that if anyone deserved the death penalty, then these filthy quislings did? There is no difference of moral principle here: the difference is simply about matter of fact. It may be a great advance in knowledge not to believe in witches: there is no moral advance in not executing them when you do not think they are there. You would not call a man humane for ceasing to set mousetraps if he did so because he believed there were no mice in the house.
No similarly one might argue --- I am not saying this is certain, but it is something to think about --- one might argue that Hitler was simply wrong about a matter of fact: Jews are not what Hitler thought they were.
I would argue that he was still culpable, but when you think about it in this light the question does at least become more subtle.