The survival of hosts during infections relies on their ability to mount effective molecular and behavioral immune responses. Despite extensive research on these defense strategies in various species, including the model organism Caenorhabditis elegans, the neural mechanisms underlying their interplay remain poorly understood. Previous studies have highlighted the role of neural G protein-coupled receptors (GPCRs) in regulating both immunity and pathogen avoidance, which is particularly dependent on aerotaxis. To address this knowledge gap, we conducted a screen of mutants in neuropeptide receptor family genes. We found that loss-of-function mutations in npr-15 activated immunity while suppressing pathogen avoidance behavior. Through further analysis, NPR-15 was found to regulate immunity by modulating the activity of key transcription factors, namely GATA/ELT-2 and TFEB/HLH-30. Surprisingly, the lack of pathogen avoidance of npr-15 mutant animals was not influenced by oxygen levels. Moreover, our studies revealed that the amphid sensory neuron ASJ is involved in mediating the immune and behavioral responses orchestrated by NPR-15. Additionally, NPR-15 was found to regulate avoidance behavior via the TRPM gene, GON-2, which may sense the intestinal distension caused by bacterial colonization to elicit pathogen avoidance. Overall, this study expands our knowledge of how neuronal GPCRs can simultaneously modulate immunity and behavior. Given the conserved nature of the GPCR and immune signaling pathways studied, the findings contribute to a broader understanding of host defense strategies and mechanism underlining the interplay between immunity and behavior across species.