Sonic Adventure 2 seems to have an Idiot Plot where people can't tell the difference between Sonic and Shadow, resulting in Sonic being framed when Shadow steals the Chaos Emerald. However, it becomes fridge brilliance when you consider that the organization that blamed Sonic was G.U.N., which may have been framing him in order to hide Shadow's existence.
Knuckles is red
Tails is yellow
GUN knew they arrested the wrong fellow.
That aside, I imagine the reason GUN had Sonic arrested was because they planned to have him help them defeat Eggman as well as secure Shadow. Rouge working as a double agent would have made for a very interesting Sonic Adventure 2 had Sonic not escaped at the start of the game.