Are you supposed to use a vaporizer for a 2 year old child with pneumonia?

No. You are not "supposed" to have a vaporizer. If you have one and it helps humidify the air then ok. I would not suggest buying one for pneumonia. Humidifiers and vaporizers are not as popular as they were years ago as the hot ones can burn a toddler who gets out of bed and the cool ones can grow germs if the water is not changed regularly. If it works for you, then use it. Otherwise no worries.