The energy-absorbing material of metal foam have enormous potential in mitigating the consequences of natural gas explosion disaster in urban utility tunnels. When double-layer metal foam with different pore structures of first larger pores and then smaller pores (LP-SP model), the suppression efficiency of explosion overpressure can reach more than 60% and is 2–3 times that of first smaller pores and then larger pores (SP-LP model), and the error between that and that of the same thickness all with smaller pore structure is only 0.86%. Similarly, the metal foams with the LP-SP model can block the explosion flame propagation chain entirely, while reversing the combination order weakens the suppression effect on the explosion flame. Two suppression mechanisms of double-layer metal foam, including the Sudden Shrinkage Effect (SSE) of the LP-SP model and the Amplification Effect (AE) of the SP-LP model. The metal foam barrier device based on SSE is designed for utility tunnels, which can take effect within 0.1 s under electromagnetic force and gravity. This study can provide scientific theoretical support for designing gas explosion suppression measures in utility tunnels.