If there are 2 pigs, and you summon lightning at both of them, the first lightning bolt will say "make 2 pigmen", the second lightning bolt will think the same thing, so 4 pigmen will be created. With many pigmen and many bolts this adds up fast. The command we were using was /execute @e ~ ~ ~ summon LightningBolt ~ ~ ~
Linked issues
Comments 2
It seems to only with villagers and pigs because it summons a new mob at the villager/pig, then removes the villager/pig. for a temporary fix, update your command to:
/execute @e[type=Pig] ~ ~ ~ summon LightningBolt ~ ~ ~
It seems that lightning gets summoned at the pig, which spawns a zombie pigman at the pigs location, and before the pig is removed, another lightning bolt is summoned at the zombie pigman, also striking the pig, creating a second pigman, and finally removing the pig.
More testing, it works with witches but not creepers.