Collapsing glomerulopathy is a histologically distinct variant of focal and segmental glomerulosclerosis that presents with heavy proteinuria and portends a poor prognosis. Collapsing glomerulopathy can be triggered by viral infections such as HIV or SARS-CoV-2. Transcriptional profiling of collapsing glomerulopathy lesions is difficult since only a few glomeruli may exhibit this histology within a kidney biopsy and the mechanisms driving this heterogeneity are unknown. Therefore, we used recently developed digital spatial profiling (DSP) technology which permits quantification of mRNA at the level of individual glomeruli. Using DSP, we profiled 1,852 transcripts in glomeruli isolated from formalin fixed paraffin embedded sections from HIV or SARS-CoV-2-infected patients with biopsy-confirmed collapsing glomerulopathy and used normal biopsy sections as controls. Even though glomeruli with collapsing features appeared histologically similar across both groups of patients by light microscopy, the increased resolution of DSP uncovered intra- and inter-patient heterogeneity in glomerular transcriptional profiles that were missed in early laser capture microdissection studies of pooled glomeruli. Focused validation using immunohistochemistry and RNA in situ hybridization showed good concordance with DSP results. Thus, DSP represents a powerful method to dissect transcriptional programs of pathologically discernible kidney lesions.