can be either a situation where power is still getting to the coil, even though you think you've shut it off. this could be from a defective ignition switch or backfeeding through another circuit. it could also be "dieseling" due to ignition happening without a spark, perhaps from a hotspot in the cylinder - often caused by carbon deposits. you can stop this with higher octane fuel or cutting off the air.
try pulling out the choke (if its manual) after you turn off the ignition. this can often stop the dieseling.