Yes it is supposed to go into your digestive system, or at least what doesn't come out is supposed to go there. Mucus has antibodies in it that kill/disable/injur pathogens and carry them into the acidy destruction zone that is your stomach.
Your immune system learns to finish killing the pathogens. One reason you can spread disease via mucus coming out is because YOUR mucus and YOUR immune system work together, and someone else's immune system may not be able to deal with pathogens that were injured by your mucus.
Also mucus simply grabs organisms that are trying to establish a base in your throat and carries them to the stomach where they can't do their thing anymore.