Maybe it's only certain games?
That said, since I only played Mario Kart DS online for one day for some unbeknownst reason, I had forgotten that there is the option to play people other than your friends that you've traded codes with.
In CastleVania: Portrait Of Ruin the other day I was surprised that I could go to random people's shops, which was okay because I just needed a Long Sword that I'd stupidly sold but needed for a Quest. In that case I guess it doesn't matter much if you by from a friend or a stranger, especially considering that stock isn't ever depleted. Weird.
Anyway, in this case, since it's a Nintendo game (Pokémon Company/Genius Sonority/whoever) and it's a Pokémon game, it could just be to protect the particular demographic that make up the majority of Pokémon players (even though if anyone truly thinks Pokémon is just for kids they're sorely mistaken).