The kart minigame opens up after you clear the story-mode chapter built around the car chase — the one where Rouge pursues Tails, or Tails chases the president, depending on which side you are playing.
Finish that level and the two-player mode becomes selectable. It is a story-progress reward rather than something you buy or find hidden in a menu.