Gravity storage IS subject to the same law, why do you believe it isn’t?
Burning hydrocarbons is problematic for a host of reasons besides CO2 release: fracking, oil spills, release of other pollutants, political issues with the supplier countries, pipelines, ...