How multitrophic relationships between wildlife communities and their ectoparasitic vectors interact to shape the diversity of vector-borne microorganisms is poorly understood. Nested levels of dependence among microbes, vectors, and vertebrate hosts may have complicated effects on both microbial community assembly and evolution. We examined Bartonella sequences from European bats and their ectoparasites with a combination of network analysis, Bayesian phylogenetics, tipassociation and cophylogeny tests, and linear regression to understand the ecological and evolutionary processes that shape parasite communities. We detected seven batectoparasite-Bartonella communities that can be differentiated based on bat families and roosting patterns. Tips of the Bartonella tree were significantly clustered by host taxonomy and geography. We also found significant evidence of evolutionary congruence between bat host and Bartonella phylogenies, indicating that bacterial species have evolved to infect related bat species. Exploring these ecological and evolutionary associations further, we found that sharing of Bartonella species among bat hosts was strongly associated with host phylogenetic distance and roost sharing and less strongly with geographic range overlap. Ectoparasite sharing between hosts was strongly predicted by host phylogenetic distance, roost sharing, and geographic overlap but had no additive effect on Bartonella sharing. Finally, historical Bartonella host-switching was more frequent for closely related bats after accounting for sampling bias among bat species. This study helps to disentangle the complex ecology and evolution of Bartonella bacteria in bat species and their arthropod vectors. Our work provides insight into the important mechanisms that partition parasite communities among hosts, particularly the effect of host phylogeny and roost sharing, and could help to elucidate the evolutionary patterns of other diverse vector-borne microorganisms.