Why is it that they put patients on their stomachs when they have got pneumonia?

They don't! Putting people on their stomachs is not a treatment for pneumonia . What might cause confusion is that some with pneumonia & respiratory failure need a ventilator to breath. Some of these patients can get a form of lung injury called " Acute respiratory distress syndrome". In this situation it can help to place the patient on their belly ( prone ventilation) as it is easier to inflate the lung.