Here's what I would picture. It's not perfect, but neither is the system we've got now with regular DS games.
You put the game in. Each individual Game Card has a unique serial number in the card's programming. You select "Download Card". The 3DS connects to Nintendo's server, authenticates the card and checks to see if the flag for this serial number is on. If it's on, the download is denied. If it's off, then the server turns the flag on and approves the download.
To delete the game, there's two options.
One, it'll need the game card, reconnect to the server and "unflag" it.
Or, two, you won't need the game card, but once you download to the 3DS, that card is tied to that system and you can't download it to any other systems ever.