Host-associated microbiomes are integral components of host health, but microbiome community structure varies among and within hosts. Reconciling community variability with the apparent dependence of hosts on community function, and characterizing how functional divergence proceeds across niches, remains challenging. Here, through the study of gut microbiomes and diets of three insectivorous bat species we characterize how community structure is shaped by predicted functional properties of community members. We found that while host diet and microbiome community composition do not significantly relate to each other, host diet and metagenome function do, suggesting that diet directly selects metagenomic functions rather than communities. We use a novel inference framework to show how the discordance between community structure and functional variation derives from functional equivalence and is influenced by the continuum of shared and derived gene sets across microbial lineages. Our findings help clarify how metagenome community structure-function relationships contribute to deterministic processes in community assembly, and describe the basis for metagenomic differences across ecologically similar hosts.