Selective autophagy is a catabolic process with which cellular material is specifically targeted for degradation by lysosomes. The function of selective autophagic degradation of self-components in the regulation of innate immunity is still unclear. Here we show that Drosophila Kenny, the homolog of mammalian IKKγ, is a selective autophagy receptor that mediates the degradation of the IκB kinase complex. Selective autophagic degradation of the IκB kinase complex prevents constitutive activation of the immune deficiency pathway in response to commensal microbiota. We show that autophagy-deficient flies have a systemic innate immune response that promotes a hyperplasia phenotype in the midgut. Remarkably, human IKKγ does not interact with mammalian Atg8-family proteins. Using a mathematical model, we suggest mechanisms by which pathogen selection might have driven the loss of LIR motif functionality during evolution. Our results suggest that there may have been an autophagy-related switch during the evolution of the IKKγ proteins in metazoans.