Electrical nightmare

Got a 2004 6×6 it has lots of spark till it fires I’ll explain
When plug is out have lots of spark and will spark forever put the plug in the head it will fire right up than die. It won’t start sparking till I turn the key off than back on. Even drained the fuel from the carb put the plug in turned it over with a spark tester hooked up between the plug and wire and got constant spark till I put fuel to it and it fired up for 2 seconds than lost spark again till I reset the key