To investigate the effects of barrier spacing gradients on gas explosions in confined spaces, a large eddy simulation (LES) based on the Charlette turbulent combustion model was employed to simulate the coupling process of explosion flame, turbulent flow, and pressure wave under multi-stage obstacles with spacing gradients of 0, 0.005, 0.010, and 0.015. The results indicate that vorticity increases on the obstacle surfaces as the flame passes through them, accompanied by backflow vortices. When the spacing gradient reaches 0.010 and 0.015, the flame front becomes sharper, and both the flame propagation velocity and the rate of change in flame surface area are higher in the later stages of the explosion. The peak values and corresponding areas of flame propagation velocity, as well as the peak rate of flame surface area change, follow the descending order of conditions: 0.015, 0.010, 0.005, and 0. Furthermore, a higher obstacle spacing gradient enhances combustion efficiency and promotes pressure accumulation, leading to an increase in the maximum overpressure with larger spacing gradients.