First, ensure the pilot assembly and ignition module are grounded. The pilot can be grounded by using a double insulated or bare, solid copper wire from a mounting screw directly to the "GND" terminal on the module, if so equipped, otherwise to chasis. You can also ground the neutral side of the 24V transformer.
If that doesn't work, consider an isolation transformer.
If that doesn't work, consider an isolation transformer.