Several factors can affect the density of mobile DNA in bacterial genomes including rates of exposure to novel gene pools, recombination, and reductive evolution. These traits are difficult to measure across a broad range of bacterial species, but the ecological niches occupied by an organism provide some indication of the relative magnitude of these forces. Here, by analyzing 384 bacterial genomes assigned to three ecological categories (obligate intracellular, facultative intracellular, and extracellular), we address two, related questions: How does the density of mobile DNA vary across the Bacteria? And is there a statistically supported relationship between ecological niche and mobile element gene density? We report three findings. First, the fraction of mobile element genes in bacterial genomes ranges from 0 to 21% and decreases significantly: facultative intracellular > extracellular > obligate intracellular bacteria. Results further show that the obligate intracellular bacteria that host switch have a higher mobile DNA gene density than the obligate intracellular bacteria that are vertically transmitted. Second, while bacteria from the three ecological niches differ in their average mobile DNA contents, the ranges of mobile DNA found in each category overlap a surprising extent, suggesting bacteria with different lifestyles can tolerate similar amounts of mobile DNA. Third, mobile DNA gene densities increase with genome size across the entire dataset, and the significance of this correlation is dependent on the obligate intracellular bacteria. Further, mobile DNA gene densities do not correlate with evolutionary relationships in a 16S rDNA phylogeny. These findings statistically support a compelling link between mobile element evolution and bacterial ecology.