Solution 1: Code is not visible by simply flipping to back of book, rather it is under a "tear off". This would require you to actually "damage" a book you haven't paid for to get it. You get caught, that's destruction of property.
Solution 2: Code is on a mini-CD, so unless you either steal the disc, or brought a lap-top, you're not going to be able to get the code without buying the book and taking it home.
Solution 3: each book has an identifiable scan code so that WotC knows when it has _actually_ been purchased. You write down the code and attempt to use it and it won't work unless book has been scanned by retailer.
Solution 4: unlocking book with code also requires input of code or information from the receipt. No receipt, no working code.
Solution 5: Explosive Runes