According to my arch nemesis Myron who sat near me in kindergarten, they are for eating. He was so gross. He never had the decency to wipe them on the underside of the desk like all the other semi civilized children of quality.
It keeps the lining of the nose from drying out, warms the air you breathe and traps foreign particles (dust, pollen etc) that could irritate the lungs.
Its to trap dirt and particles to keep.it out of your airways. It is also been shown they help bolster the immune system. When pollens, spores, and pathogens are trapped in them. It has been shown that once allergens and pathogens are trapped in them that they help the body build immunity without infection when they are ingested by sniffling. Its assumed this is why kids have a natural inclination to pick noses and eat them. Gross at but its true.
Snot and booger are there to help your immune system.