It is an urban myth that people swallow spiders while sleeping. In reality, spiders tend to shy away from sleepers, who give off strange breathing vibrations and are not normal spider food. The arachnids prefer their own webs and prey.
Spiders typically don't approach humans, who they perceive as too large and dangerous to be food. The sleeper's bed may have insects, such as bed bugs, that attract the spider. Sleepers usually awaken or brush their hands across their faces if an insect crawls over the skin. It's unlikely that a spider will find its way into a sleeper's mouth, but even if one did get swallowed, the digestive acids of the stomach would kill it before any damage could be done.