Because the decomposition is the reverse process of the formation.
Enthalpy is a function of state, which means that the value dependes only on the state and not the pathway.
Then the change of enthalpy is the same in magnitude for both cases but in formation the change is netavie (releases energy) and in the other is postive (absorbs energy).