For the sake of people's health and the safety of the environment, more efforts should be directed towards the fabrication of gas sensors that can operate effectively at room temperature (RT). In this context, increased attention has been paid to developing gas sensors based on rare-earth (RE)-doped transparent conducting oxides (TCO). In this report, lanthanum-doped zinc oxide (La-doped ZnO) films were fabricated by sol–gel and spin-coating techniques. XRD analysis revealed the hexagonal structure of the ZnO films, with preferred growth along the (002) direction. The crystallite size was decreased from 33.21 to 26.41 nm with increasing La content to 4.0 at.%. The UV–vis–NIR indicating that the films are highly transparent (˃ 80%), La-doping increased the UV blocking ability of the films and narrowed the optical band gap (Eg) from 3.275 to 3.125 eV. Additionally, La-doping has influenced the refractive index of the samples. Gas sensing measurements were performed at ambient temperature (30 °C) and a relative humidity (RH) of 30%, employing different flow rates of carbon dioxide (CO2) gas used synthetically with air. Among the evaluated sensors, the ZnO: 4.0 at.% La sensor exhibited the most significant gas response, with a value of 114.22%. This response was observed when the sensor was subjected to a flow rate of 200 SCCM of CO2 gas. Additionally, the sensor revealed a response time of 24.4 s and a recovery time of 44 s. The exceptional performance exhibited by the sensor makes it very appropriate for a wide range of industrial applications. Additionally, we assessed the effect of humidity, selectivity, reusability, repeatability, detection limit, and limit of quantification.