The impact of moisture inside internal end-face gaps of optical components on the measurements quality of infrared moisture meter for sulfur hexafluoride (SF6) gas-insulated equipment (GIE) is explored. The distortion of observed absorption line shapes occurs when the background absorption spectrum of moisture existing inside internal end-face gaps of optical components at atmospheric pressure is superposed on the desired absorption spectrum of moisture in SF6 GIE where the pressure exceeds 1 atm. Errors that arise with the measurements of moisture concentration and pressure because of line shape distortion effects in infrared absorption spectroscopy are quantitatively analyzed. A correction algorithm is proposed for the dual-beam balanced ratiometric detector strategy to improve the measuring precision. This algorithm eliminates the line shape distortion effects caused by moisture inside optical components and conducts a successful moisture measurement and control program for SF6 GIE. In our experiments, the impacts of moisture inside optical components have been suppressed, and the mean absolute errors have been decreased by 86.0% and 76.1%, respectively.