We study the carbon monoxide (CO) excitation, mean molecular gas density, and interstellar radiation field (ISRF) intensity in a comprehensive sample of 76 galaxies from local to high redshift (z ∼ 0–6), selected based on detections of their CO transitions J = 2 → 1 and 5 → 4 and their optical/infrared/(sub)millimeter spectral energy distributions (SEDs). We confirm the existence of a tight correlation between CO excitation as traced by the CO (5–4)/(2–1) line ratio R
52 and the mean ISRF intensity as derived from infrared SED fitting using dust SED templates. By modeling the molecular gas density probability distribution function (PDF) in galaxies and predicting CO line ratios with large velocity gradient radiative transfer calculations, we present a framework linking global CO line ratios to the mean molecular hydrogen gas density and kinetic temperature T
kin. Mapping in this way observed R
52 ratios to and T
kin probability distributions, we obtain positive – and –T
kin correlations, which imply a scenario in which the ISRF in galaxies is mainly regulated by T
kin and (nonlinearly) by . A small fraction of starburst galaxies showing enhanced could be due to merger-driven compaction. Our work demonstrates that ISRF and CO excitation are tightly coupled and that density–PDF modeling is a promising tool for probing detailed ISM properties inside galaxies.