Objective To compare the diagnostic value of metagenomic next-generation sequencing (mNGS) and conventional etiological detection methods in pulmonary infections in human immunodeficiency virus (HIV)-infected individuals and non-HIV-infected individuals, and to analyze the characteristics of pathogen spectrum in the two groups. Methods Seventy-five HIV-positive patients with pulmonary infection (HIV-infected group) and 75 HIV-negative patients with pulmonary infection (non-HIV-infected group) were enrolled. Parallel tests were conducted using mNGS (for bronchoalveolar lavage fluid detection) and conventional etiological detection methods (for bronchoalveolar lavage fluid and blood specimen detections) respectively. General clinical data, inflammatory indicators, and pathogen spectrum distribution, as well as the positive pathogen detection rate and mixed infection detection rate of the two detection methods, were compared between the two groups. Results The age, white blood cell count, absolute neutrophil count, and levels of C-reactive protein and procalcitonin in the HIV-infected group were lower than those in the non-HIV-infected group (all P<0.05); there was no statistically significant difference in gender or absolute lymphocyte count between the two groups (all P>0.05). In the HIV-infected group, the positive pathogen detection rate of mNGS was higher than that of conventional etiological detection methods (93.33% vs 62.67%, P<0.05), and the mixed infection detection rate of mNGS was also higher than that of conventional etiological detection methods (88.00% vs 42.67%, P<0.05). Results of of mNGS identified 46 pathogens in the HIV-infected group and 37 pathogens in the non-HIV-infected group, with 18 pathogens detected in both groups. The positive detection rates of Epstein-Barr virus, human cytomegalovirus, Pneumocystis jirovecii, Talaromyces marneffei, Haemophilus influenzae, and mycobacteria in the HIV-infected group were higher than those in the non-HIV-infected group; in contrast, the non-HIV-infected group showed higher positive rates of Streptococcus pneumoniae, Stenotrophomonas maltophilia, Enterococcus faecium, Pseudomonas aeruginosa, Acinetobacter baumannii, Klebsiella pneumoniae, and Staphylococcus aureus (all P<0.05). In terms of mixed infection patterns, the HIV-infected group was dominated by triple infections of "virus + fungus + bacteria" (68.18%), whereas the non-HIV-infected group was mainly characterized by simple bacterial co-infections ("bacteria + bacteria", 63.49%). Conclusion Pulmonary infections in HIV-infected patients are characterized by a pathogen spectrum dominated by opportunistic viruses and fungi, and multiple mixed infections, while pulmonary infections in non-HIV-infected individuals are predominantly caused by common bacteria. mNGS is superior to conventional etiological detection methods in both positive pathogen detection rate and mixed infection detection rate, which is of great significance for accurate etiological diagnosis in immunocompromised populations.