Sneezing usually occurs because there are bullies particles in your nose. Nerve endings in the nose stimulates you sneeze to get rid of those particles.
At the time of sneezing, your eyes closed, because there are nerves in the nose and the eyes is actually related to each other, so that when we sneeze, our eyes will automatically be closed. This is to protect the tear ducts and blood capillaries to avoid contamination by the bacteria out of the nasal membranes.
Actually sneezing also has the benefit of keeping your nose clean, sneezing which occurs over and over again is expected to help the cleanup efforts in the nasal cavity