Well, no one knows for sure.But current thinking is it's due to a genetic quirk affecting about one in four people.The optic nerve (which tells your pupil to open and close, depending on the amount of light entering the eye) is very close to your trigeminal nerve (which tells your brain when there's dirt etc in your nose that needs to be sneezed out).In some people, those wires get a little crossed.  So the instruction to close your eye's iris, also gets interpreted as the signal to sneeze.