Vidura is the incarnation of Yamaraja who, being cursed by Manduka Muni, was to become a sudra
SB Canto 1
SB Canto 3
Nitāi: "As long as Vidura played the part of a śūdra, being cursed by Maṇḍūka Muni, Aryamā officiated at the post of Yamarāja to punish those who committed sinful acts."
Prabhupāda: So Vidura is Yamarāja, the superintendent of death. After our death, we are brought before the justice Yamarāja, what kind of next birth I may have. So Yamarāja is not śūdra. He is devotee of Lord Kṛṣṇa, although he has the duty to punish the criminals. Just like a magistrate is always punishing the criminals. That is his business, but he is not criminal. He is giving judgment to the criminals. Similarly, Yamarāja is the appointed magistrate, superintendent. After death, one has to go before him and take the judgment of his next life. This is the process.
So Vidura was cursed by Maṇḍūka Muni, Maṇḍūka Muni. He was a great sage, but sometimes in his āśrama, some thieves were caught, so police arrested both the Maṇḍūka Muni and the thieves, and later on Maṇḍūka Muni was chastised to be punished by śūla. There was a system of punishment. I do not whether (it is) still existing. The śūla means one lance, lancer. Lancer, it is called?
Prabhupāda: It was to be pierced through the rectum and it will go through the head and the man will die. The pierce was standing, and he was to sit down. What is this punishment? Is there any mention?
Puṣṭa-kṛṣṇa: I never heard of anything.
Guru-gaurāṅga: Arabians have this. It is called pala(?).
Prabhupāda: Śūla punishment. So when he was condemned to the śūla punishment, then the king heard that "Maṇḍūka Muni, the great sage, he is punished like that?" Immediately he stopped. "What is this nonsense that Maṇḍūka Muni has been punished? He is a great sage." So the king stopped the punishment and immediately came to see what has happened. Then he was immediately released. But he was very sorry, that "Why the judge Yamarāja punished him like that?" So he asked Yamarāja, "Why you have punished me like this?" "Now, in your childhood you pierced the rectum of an ant with a...," what is called?
Devotees: Pin, straw.
Prabhupāda: No, not straw. Prick, pricking?
Prabhupāda: Kāṇṭā, kāṇṭā. We say kāṇṭā, that pricks. What is called?
Prabhupāda: Ah, thorn, yes. So therefore he was punished. Now just see. In his childhood he was playing with an ant, piercing the rectum with a thorn. That is also taken account, "All right. You will be punished." Just see how finer laws are there in nature. So the Maṇḍūka Muni did that. Therefore it was recorded he should be punished like that.This is our position. Anything... If you are walking on the street, if you kill an ant by walking, you will be punished. This is nature's law. We are in such a dangerous position. In every movement there is punishment. Now, if you believe the śāstras, that is different thing. If you don't believe, then do anything you like. But from śāstra we can understand the laws of nature, or God, is very, very strict, very, very strict. So Maṇḍūka Muni also chastised Yamarāja, that "In my childhood, without any knowledge I did something and for which you have given me so great punishment. So you are not fit for becoming a brāhmaṇa or kṣatriya. You become śūdra." So he was cursed to become śūdra. Therefore Yamarāja took his birth as Vidura and was born in the womb of a śūdra mother. This is the history of Vidura's birth.