go to your 3ds home menu and click on settings. Go on your internet settings. Search for an access point and click the one that is your internet. If your internet has a password, you will be required to enter it. After doing this, press "test connection" to make sure that your connection is working. If it works, then go to random matchup and enjoy!
Other times, if you have any hacked Pokemon that you received from trades, or obtained from hacks or internet programs like pokegen, then when you go to random matchup, it won't let you search for opponents and will say "there is a problem with your Pokemon and they can't enter".
Hope this helped!
EDIT: After your comment, I remembered having that kind of problem on my 3ds. The save data and ds doesn't match thing is referring to the fact that you are playing your Pokemon game on a different ds, not the original one that you started your Pokemon game on. Thus, sometimes and error occurs when playing on a new ds saying it doesn't "match" because you're playing on a different console. Usually, when I connect to wifi on random matchup, it would ask me if I wanted to set my 3ds as my main console. Doing this erases your pal pad, but it lets you use random matchup on that console.