Sage Mandavya was wrongly impaled on a spear by a king.
When he went to heaven he asked Dharma, the god of cosmic/divine order, why he had to suffer this. Dharma explained to that he skewered insects as a child. Mandavya said that a child could not be held responsible for what it did and cursed Dharma for being born into a low class on earth.
Dharma was born as Vidura.