Determining the factors governing investment in immunity is critical to understanding host-pathogen ecological and evolutionary dynamics. Studies often consider disease resistance in the context of life-history theory, with the expectation that investment in immunity will be optimized in anticipation of disease risk. Immunity, however, is constrained by context-dependent fitness costs. How the costs of immunity vary across life-history strategies has yet to be considered. Pea aphids are typically unwinged but produce winged offspring in response to high population densities and deteriorating conditions. This is an example of polyphenism, a strategy used by many organisms to adjust to environmental cues. The goal of this study was to examine the relationship between the fitness costs of immunity, pathogen resistance and the strength of an immune response across aphid morphs that differ in life-history strategy but are genetically identical. We measured fecundity of winged and unwinged aphids challenged with a heat-inactivated fungal pathogen, and found that immune costs are limited to winged aphids. We hypothesized that these costs reflect stronger investment in immunity in anticipation of higher disease risk, and that winged aphids would be more resistant due to a stronger immune response. However, producing wings is energetically expensive. This guided an alternative hypothesis - that investing resources into wings could lead to a reduced capacity to resist infection. We measured survival and pathogen load after live fungal infection, and we characterized the aphid immune response to fungi by measuring immune cell concentration and gene expression. We found that winged aphids are less resistant and mount a weaker immune response than unwinged aphids, demonstrating that winged aphids pay higher costs for a less effective immune response. Our results show that polyphenism is an understudied factor influencing the expression of immune costs. More generally, our work shows that in addition to disease resistance, the costs of immunity vary between individuals with different life-history strategies. We discuss the implications of these findings for understanding how organisms invest optimally in immunity in the light of context-dependent constraints.