I found this help topic somewhere
When you complete one of the story modes, go to the challenge screen. Notice that one of the stages is not there. To play this stage you must get all seven Chaos Emeralds. You can get the Chaos Emeralds by playing the stages before you face the Boss.
Get the key for that stage and go to the bonus stage. Then, catch the Chaos Emerald before you get to the end of the bonus stage. Once you get the all seven Chaos Emeralds, you can play the final stage. There is only one Chaos Emerald for each set of levels.
I did that and I did story mode with all the teams!