Shadow's hostility toward Sonic is really only a feature of Sonic Adventure 2, where he's positioned as an antagonist for most of the game. In later titles, Shadow is generally neutral toward Sonic rather than outright antagonistic.
So it's less that Shadow is a permanent "hater" and more that their rivalry was written that way for that particular story. Their relationship mellows considerably afterward.