We don't sneeze while sleeping because our mucous membranes swell and hence not much dust or other particles come into contact with them. Also during sleep, the mucous membrane cannot relay the reflex signal to the brain which causes the sneeze.
There are many reasons why humans sneeze. Surprisingly, humans may sneeze when there is sudden exposure to bright light, a sudden change or fall in temperature, a breeze of cold air, a particularly full stomach, or viral infection, such as cold or flu. However, the most common reason we sneeze is when something irritates the mucous membranes.
The human nose consists of a mucous membrane at the nostrils. These membranes are present at nearly any opening into the human body, as well as other places. Their job is to protect the inside of the body from external environment including foreign particles. Hence, when the mucous membrane at the nostrils come into contact with foreign particles such as dust, pollen, etc., its response is to trigger a reflex signal in the brain which causes us to sneeze and expel the foreign particle from either our nose or mouth.
However, it is impossible to sneeze while we are sleeping. This happens due to the combination of two things. One is that when we sleep, the mucous membranes swell when we lie down, however, there usually isn't much airflow or movement to stir up dust or other particles that would come into contact with the membrane to cause irritation. Secondly, when we sleep, our body enters a state where the motor neurons are not stimulated and reflex signals are not relayed to the brain. Hence, even if our mucous membranes become irritated, they cannot relay the reflex signal to cause us to sneeze.
Still, if the irritation is strong enough, such as when a friend is tickling your nose with a feather, so an actual reason you should sneeze, then the mind with wake up the body to sneeze. However, this sneeze might be done in a partially awake status at minimum, which means that the person might not even remember it in the morning.