I suspect this happened because the lizard received an injury significant enough to the side of its tail to trigger a regeneration response, but not severe enough to lose it.
The mechanism of regeneration in lizards and salamanders is pretty interesting. Basically, a significant injury will cause a release of signaling peptides that leads to de-differentiating mature cells, back into pluripotent stem cells, and thereby growing new muscle, vasculature, bones, scales…. In this case, it led to an unusual result, but not as unusual as as some. In extreme cases, a second head can be grown.