Removal of the reproductive system of many animals including fish, flies, nematodes, mice and humans can increase lifespan through mechanisms largely unknown. The abrogation of the germline in Caenorhabditis elegans increases longevity by 60% due to a signal emitted from the somatic gonad. Apart from increased longevity, germline-less C. elegans is also resistant to other environmental stressors such as feeding on bacterial pathogens. However, the evolutionary conservation of this pathogen resistance, its genetic basis and an understanding of genes involved in producing this extraordinary survival phenotype are currently unknown. To study these evolutionary aspects we used the necromenic nematode Pristionchus pacificus, which is a genetic model system used in comparison to C. elegans. By ablation of germline precursor cells and subsequent feeding on the pathogen Serratia marcescens we discovered that P. pacificus shows remarkable resistance to bacterial pathogens and that this response is evolutionarily conserved across the Genus Pristionchus. To gain a mechanistic understanding of the increased resistance to bacterial pathogens and longevity in germline-ablated P. pacificus we used whole genome microarrays to profile the transcriptional response comparing germline ablated versus un-ablated animals when fed S. marcescens. We show that lipid metabolism, maintenance of the proteasome, insulin signaling and nuclear pore complexes are essential for germline deficient phenotypes with more than 3,300 genes being differentially expressed. In contrast, gene expression of germline-less P. pacificus on E. coli (longevity) and S. marcescens (immunity) is very similar with only 244 genes differentially expressed indicating that longevity is due to abundant gene expression also involved in immunity. By testing existing mutants of Ppa-DAF-16/FOXO and the nuclear hormone receptor Ppa-DAF-12 we show a conserved function of both genes in resistance to bacterial pathogens and longevity. This is the first study to show that the influence of the reproductive system on extending lifespan and innate immunity is conserved in evolution.