The importance of the diffuse ionized gas for interpreting galaxy spectra