Two sides of the same coin.
One can learn lots about Eggman through Sonic. While his first bio says he's not a hero, can't forget the "strong sense of justice" and "warm at heart" part, later described as his "voice inside"/"heart of gold."
Take that heart away and you get Eggman
To me, modern Eggman is basically him being a wannabe super hero. Bro has gone so mad after every failure that now he sees himself as someone like Batman.