Men having sex with men (MSM) represent a key population, in which sexually transmitted rectal infections (STIs) caused by Chlamydia trachomatis (CT), Neisseria gonorrhoeae (NG) and high-risk HPV (HR-HPV) are very common and linked to significant morbidity. Investigating the anorectal microbiome associated with rectal STIs holds potential for deeper insights into the pathogenesis of these infections and the development of innovative control strategies. In this study, we explored the interplay at the rectal site between C. trachomatis, N. gonorrhoeae, HR-HPV infection, and the anorectal microbiome in a cohort of 92 MSM (47 infected by CT and/or NG vs 45 controls). Moreover, we assessed the presence of Torquetenovirus (TTV), a non-pathogenic endogenous virus, considered as a possible predictor of immune system activation. We found a high prevalence of HR-HPV rectal infections (61%), especially in subjects with a concurrent CT/NG rectal infection (70.2%) and in people living with HIV (84%). In addition, we observed that TTV was more prevalent in subjects with CT/NG rectal infections than in non-infected ones (70.2% vs 46.7%, respectively). The anorectal microbiome of patients infected by CT and/or NG exhibited a reduction in Escherichia, while the presence of TTV was significantly associated with higher levels of Bacteroides. We observed a positive correlation of HR-HPV types with Escherichia and Corynebacterium, and a negative correlation with the Firmicutes phylum, and with Prevotella, Oscillospira, Sutterella. Our findings shed light on some of the dynamics occurring within the rectal environment involving chlamydial/gonococcal infections, HPV, TTV, and the anorectal microbiome. These data could open new perspectives for the control and prevention of STIs in MSM.