The spark you see is completely normal, it has to do with inductance. Any wire loop (any conductor has small inductance), such as a transformer, has an inductance. The transformer has a magnetic field (or lack of one) and when you plug-in or unplug the cord, current flows/stops and the magnetic field changes. Nature abhors a change in flux (change in the amount of mag field) and a counter current is induced by the inductor. This current causes the spark.