From what I've read, resetting too many times, time travelling too much, quitting while the game is saving, dropping the 3DS, taking the cartridge or SD card out while it's in use, and failing at the duplication glitch can all increase your chances of a data corruption. Did you happen to do any of these things? I'm not completely sure if resetting too much (like plot resetting) or TTing too much can increase your chances at corruption, though.