Eggman made a machine to kill Sonic but that machine made Sonic act like a pet. Shadow is taking care of Sonic, because Tails, Amy and Cream can't catch up with him if he runs away Knuckles watches the Master Emerald already and Rouge didn't want to. So Shadow was left over since he is as fast as Sonic and he can teleport. But in this picture he isn't in the mood of running for when Sonic runs away and letting him wear a dog collar because he knows he was still able to run away then. So he carries him around like this. Eggman sees them and watches the show.
Why is it that Sonic may not run away? Because Tails has to figure out how to turn Sonic back. And he needs Sonic with that.