Make sure the Micro SD card is not locked to Read-only mode. There may be a small tab on the of the card that says "lock".
If you are using an FTP client like Filezilla to move files without removing the SD card from the 3DS, make sure it is set to Binary mode, not ASCII mode.
When exporting the save from PKHeX, you don't try to export directly to the SD card, export the file to a location on your computer, (like your desktop), THEN copy it back to your SD card.
If you've done all of the above and it still corrupts, then make sure PKHeX and Checkpoint are both up to date, or try JKSM instead of Checkpoint.
Keep an unedited working backup of any and all savefiles you don't want to lose.