Host-associated microbiomes vary greatly in composition both within and between host individuals, providing the raw material for natural selection to act on host-microbe associations. Nonetheless, the drivers of compositional heterogeneity in host-associated microbiomes have only rarely been examined. To understand how this heterogeneity arises, we utilize the squash bug,Anasa tristis, and its bacterial symbionts in the genusCaballeronia. We artificially modulate symbiont bottleneck size and strain diversity during colonization to demonstrate the significance of ecological drift, which causes stochastic fluctuations in community composition. Consistent with predictions from the neutral theory of biodiversity, ecological drift alone can account for heterogeneity in symbiont community composition between hosts, even when two strains are nearly genetically identical. When acting on competing, unrelated strains, ecological drift can maintain symbiont genetic diversity among different hosts by stochastically determining the dominant strain within each host. Finally, ecological drift mediates heterogeneity in isogenic symbiont populations even within a single host, along a consistent gradient running the anterior-posterior axis of the symbiotic organ. Our results demonstrate that symbiont population structure across scales does not necessarily require host-mediated selection, but emerges as a result of ecological drift acting on both isogenic and unrelated competitors. Our findings illuminate the processes that might affect symbiont transmission, coinfection, and population structure in nature, which can drive the evolution of host-microbe symbiosis and microbe-microbe interactions within host-associated microbiomes.