Yeah, you get him by unlocking all the super-secret trophies. You have to have played every first-party game and have a save file created for them on the same day. Then before the day is over, you load up SSBM. It'll see all those game saves within that day and give you a congratulatory message thanking you for being such a Nintendo fan. Then, ironically, it unlocks Sonic for you.
However, take note that some of the game saves have to be of games that are 100% completed. Some have pretty stringent requirements. Like, the F-Zero GX save also needs to have the F-Zero AX parts unlocked.