Once an human immunodeficiency virus (HIV)-infected individual enters the onset period, a variety of opportunistic infections may occur, affecting various systems and organs throughout the body, due to the considerable reduction in the body’s immune function. The objectives of this study were to explore the relationship between immune status and microbial communities in the lungs of individuals with HIV infection. A total of 88 patients with lung disease [80 (91%) HIV-positive and 8 (9%) HIV-negative] were enrolled in our study between January and July 2018, and 88 bronchoalveolar lavage fluid (BALF) samples were obtained during bronchoscopy. In this cross-sectional study, we investigated differences in the pulmonary microbiome of patients with HIV who had different immune statuses. The diversity of bacteria in the lungs of HIV-positive individuals was lower than that in HIV-negative individuals (p < 0.05). There was a significant difference in the composition and distribution of bacteria and fungi between the HIV-positive and HIV-negative groups (p < 0.01). The number of fungal species in the BALF of HIV-positive patients was higher than in HIV-negative patients. The diversity of bacteria and fungi in the BALF of HIV-positive patients increased with decreasing CD4 T-cell counts. Linear regression analysis showed that Pneumocystis (R2 = 6.4e−03, p < 0.05), Cryptosphaeria (R2 = 7.2e−01, p < 0.05), Candida (R2 = 3.9e−02, p < 0.05), and Trichosporon (R2 = 7.7e−01, p < 0.05) were negatively correlated with CD4 counts (F-test, p < 0.05). The samples collected from HIV-positive patients exhibited a different pattern relative to those from the HIV-negative group. Differences in host immune status cause differences in the diversity and structure of lower respiratory tract microorganisms.