Are there some genetic reasons I get pneumonia off and on?

Enough antibodies? If you are an adult, it's usually a combination of genetics and environmental factors. Sometimes, the body has a problem producing antibodies (ab) that protect you from pneumonias. Your doctor can determine levels of ab classes. Also, specialists like infectious diseases doctors, can perform a vaccine challenge test to diagnose more complex problems like common variable immunodeficiency(cvid).
Hard to say. Recurrent pneumonia can be associated with some diseases that have a genetic component, for example cystic fibrosis, or some immune deficiencies. If this is a problem for someone they should really speak with a doctor and be evaluated directly.