My theory is that Eggman wants the emeralds to reverse a past mistake, in the past, one of his experiments could have mutated fellow humans into the anthromorphic animals, which explains why hes the only human, and sonic is trying to stop him to keep his powers.
Exhibit A:
There are normal animals and anthromorphic animals, isnt that weird?
Exhibit B:
Sonic doesn't really feel like a hero, hes very selfish, and insults others.
Exhibit C:
Eggman’s robots could be shelter for these animals, and the animals could not understand that hes trying to help him, which is realistic for animals already.
Exhibit D: Eggman has a good side, known for doing some good things in his past.
To put it simple, sonic could bw tricking his friends into thinking eggmans a bad guy, when under that hard boiled shell, he's only trying to help.