It forms a big part of most modern-day diets, but research suggests that sugar consumption can impair immune function for a significant period of time, by as much as 50%.
Indeed, sugar has been described as “one of the food components most damaging to our immune system.” 
What research suggests about sugar and immune function
Studies previously published in the American Journal of Clinical Nutrition and Dental Survey revealed that consuming 100 grams (3.5 ounces) of carbohydrates, such as fructose, glucose, sucrose, pasteurized orange juice and honey, inhibited the ability of white blood cells to engulf and destroy harmful microorganisms and particles which were foreign to the body.
The impairment of immune function began within less than 30 minutes after sugar ingestion and remained that way for more than five hours. At the height of immune suppression, which typically took place about two hours after sugar consumption, this important function of white blood cells was lowered by as much as 50%. 
The role of white blood cells form a significant part of the body’s defense mechanism against infections. As such, when the capabilities of white blood cells are impaired, the body’s overall immune response is greatly affected. 
Further, consuming about 75 grams of glucose has also been shown to reduce lymphocyte activity.  Lymphocytes are white blood cells produced by the tonsils, spleen and thymus that scavenge for microorganisms and toxic compounds in the body.