The books are fairly clear that becoming an Epic does not make someone evil. Instead, it just makes a person more prone to feelings of superiority, and more ready to anger.
This is a result, of course, of them channeling Calamity's image of humanity as being selfish and violent.
As noted by DafyddNZ, it's well established by the third book that using the powers sparingly helps protect a person from going crazy, and you can "gift" your powers to others without suffering from the effects.
As for why the Professor managed to come back from the edge initially, I believe that it's due to his unique fear.
The Professor's greatest fear is of failure. When he first gained his powers, he sought to be a hero and it's indicated that he failed. I think that encountering that fear led to his powers temporarily deserting him, and facing that fear gave him some degree of mastery over it, allowing him to learn how to avoid the effects by giving the powers away. However, he never truly faces his fear, repressing it and refusing to speak of it, so when he yields to using his power once more, it takes him over.
So, in short, he probably did go crazy initially, but the circumstances of his fear led to him staving off the effects until he fell off the wagon again.