Dr. Eggman hates Sonic because Sonic is always foiling his plans. Eggman is constantly scheming to take over the world (or Mobius), and Sonic never fails to swoop in and stop him. In Eggman's eyes, Sonic is the one thing standing between him and total domination.