Sometimes after coughing some mucus out of my chest into my mouth, I swallow it back. You know—spitting it out can be a production, and how bad can it really be? Its not like it goes back to the chest to re-block it. It is probably harmless.
This is not a waste product like urine. The body produces it to deal with an irritation, it then becomes inconvenient to let it sit there so we cough it out of the way. The body is not trying to get rid of the mucus.