Coal can be anything from anthracite, which is mostly carbon to bituminous coal, which contains a great deal of hydrogen and "heteroatoms" such as O, N, S, etc. If all coal were anthracite, we wouldn't have quite the problems with sulfur and mercury.
Indeed, as you say, natural gas burns cleanly without particulates and heavy metals, etc., but to make it from coal, you do need hydrogen from somewhere, and the carbon has to go somewhere.
Natural gas from the ground already has four hydrogen atoms for every carbon. If you start from coal you generally have to get your hydrogen from water, but that hydrogen is in a "low energy" state. The upshot is that whether you burn coal or methane made from coal, you end up producing about the same quantity of CO2 per unit of coal. If you don't have some way of trapping it, CO2 goes into the atmosphere as a greenhouse gas.
So it may well be that there are environmental and perhaps even economic reason for coal gasification, but it not the solution to global warming, in case anyone thought that was the case.