In many biological examples of cooperation, individuals that cooperate cannot benefit from the resulting public good. This is especially clear in cases of self-destructive cooperation, where individuals die when helping others. If self-destructive cooperation is genetically encoded, these genes can only be maintained if they are expressed by just a fraction of their carriers, whereas the other fraction benefits from the public good. One mechanism that can mediate this differentiation into two phenotypically different sub-populations is phenotypic noise. Here we show that noisy expression of self-destructive cooperation can evolve if individuals that have a higher probability for self-destruction have, on average, access to larger public goods. This situation, which we refer to as assortment, can arise if the environment is spatially structured. These results provide a new perspective on the significance of phenotypic noise in bacterial pathogenesis: it might promote the formation of cooperative sub-populations that die while preparing the ground for a successful infection. We show experimentally that this model captures essential features of Salmonella typhimurium pathogenesis. We conclude that noisily expressed self-destructive cooperative actions can evolve under conditions of assortment, that self-destructive cooperation is a plausible biological function of phenotypic noise, and that self-destructive cooperation mediated by phenotypic noise could be important in bacterial pathogenesis.