Probably one of three things, faulty electrode, faulty ht lead or faulty spark generator. The spark ignites the gas ,a signal is sent back along the ht lead to the spark gen and the sparking stops. Therefore a fault with any of them will allow sparking while grill is on.
Rooch, July 2008