If you're coughing laying down and you bring up mucus, the chance of mucus going down into your respiratory site is more probable than seated or standing up.
You're re-infecting yourself and also introducing whatever that maybe in your mouth. That's why we usually bring the head of the bed up to 45 degrees in "aspiration risk patients". Aspiration pneumonia
is a common occurrence in the elderly.