Why does a switch spark when disconnecting a coil carrying high dc current?

An inductor resists a change in current. If you have a steady state current going through an inductor and you attempt to suddenly increase the current, the inductor will nearly instantaneously present a higher resistance so that the current does not immediately change. Its resistance, then, will start to decrease as the current ramps up to the new value.

Similarly, if you have a steady state current going through an inductor and you attempt to suddenly decrease the current, the inductor will nearly instantaneously present a lower resistance so that the current does not immediately change. Its resistance, then, will start to increase as the current ramps down to the new value.

That's all just background information so you can understand what an inductor is.

If you have a steady state current going through an inductor and you attempt to suddenly decrease the current to zero by opening the circuit, the inductor will respond by attempting to maintain the current, but that current has nowhere to go. This creates a large negative voltage spike across the inductor. Think about it. Ohm's law says that voltage is current times resistance. You have some current; you have infinite resistance; therefore you must have infinite voltage. In fact, a theoretical pure inductor will do exactly that - generate an infinitely large negative voltage spike. That does not happen in practice, but it is very common to see transients of several hundred or thousand volts. This is why you need to have some kind of suppression circuit in place - otherwise that transient will go back and blow out whatever circuit is driving it.