The mammalian host has developed a long-standing symbiotic relationship with a considerable number of microbial species. These include the microbiota on environmental surfaces, such as the respiratory and gastrointestinal tracts, and also endogenous retroviruses (ERVs), comprising a substantial fraction of the mammalian genome. The long-term consequences for the host of interactions with these microbial species can range from mutualism to parasitism and are not always completely understood. The potential effect of one microbial symbiont on another is even less clear. Here we study the control of ERVs in the commonly used C57BL/6 (B6) mouse strain, which lacks endogenous murine leukaemia viruses (MLVs) able to replicate in murine cells. We demonstrate the spontaneous emergence of fully infectious ecotropic MLV in B6 mice with a range of distinct immune deficiencies affecting antibody production. These recombinant retroviruses establish infection of immunodeficient mouse colonies, and ultimately result in retrovirus-induced lymphomas. Notably, ERV activation in immunodeficient mice is prevented in husbandry conditions associated with reduced or absent intestinal microbiota. Our results shed light onto a previously unappreciated role for immunity in the control of ERVs and provide a potential mechanistic link between immune activation by microbial triggers and a range of pathologies associated with ERVs, including cancer.