Reduced biodiversity and increased representation of opportunistic pathogens are typical features of gut microbiota composition in aging. Few studies have investigated their correlation with polypharmacy, multimorbidity and frailty. To assess it, we analyzed the fecal microbiota from 76 inpatients, aged 83 ± 8. Microbiome biodiversity (Chao1 index) and relative abundance of individual bacterial taxa were determined by next-generation 16S rRNA microbial profiling. Their correlation with number of drugs, and indexes of multimorbidity and frailty were verified using multivariate linear regression models. The impact of gut microbiota biodiversity on mortality, rehospitalizations and incident sepsis was also assessed after a 2-year follow-up, using Cox regression analysis. We found a significant negative correlation between the number of drugs and Chao1 Index at multivariate analysis. The number of drugs was associated with the average relative abundance of 15 taxa. The drug classes exhibiting the strongest association with single taxa abundance were proton pump inhibitors, antidepressants and antipsychotics. Conversely, frailty and multimorbidity were not significantly associated with gut microbiota biodiversity. Very low Chao1 index was also a significant predictor of mortality, but not of rehospitalizations and sepsis, at follow-up. In aging, polypharmacy may thus represent a determinant of gut microbiota composition, with detrimental clinical consequences.