The endometrium has traditionally been considered sterile. Nowadays, active studies are performed on the female upper genital tract microbiota. Bacteria and/or viruses colonizing the endometrium are known to alter its functional properties, including receptivity and embryo implantation. Uterine cavity inflammation caused by microorganisms leads to disrupted cytokine expression, which, in turn, is mandatory for the successful implantation of the embryo. The present study assessed the vaginal and endometrial microbiota composition and its relation to the levels of cytokines produced by the endometrium in reproductive-aged women complaining of secondary infertility of unknown origin. The multiplex real-time PCR assay was applied for vaginal and endometrial microbiota analysis. The quantitative measurement of endometrial α-defensin (DEFa1), transforming growth factor (TGFβ1), and basic fibroblast growth factor (bFGF2) was carried out using the ELISA (Cloud-Clone Corporation (Katy, TX, USA; manufactured in Wuhan, China). A reliable decline in endometrial TGFβ1 and bFGF2 and an increase in DEFa1 were demonstrated in women with idiopathic infertility when compared to fertile patients. However, TGFβ1, bFGF2, and DEFa1 expression correlated reliably only with the presence of Peptostreptococcus spp. and HPV in the uterine cavity. The obtained results highlight the importance of local immune biomarker determination in the assessment of certain bacteria and viruses’ significance as causative agents of infertility.