Balak's princes were much amazed at this extraordinary miracle, but the ass died the moment she had spoken what she had to say. God did this for two reasons, firstly because He feared that the heathens might worship this ass were she to stay alive; and secondly because God wanted to spare Balaam the disgrace of having people point to his ass and say, "This is she that worsted Balaam." By this action it can be seen how highly God prizes the honor or pious men, if He even sought to spare the honor of this villain. It is out of consideration to mankind, also, that God has closed the mouth of animals, for were they to speak, man could not well use them for his service, since the ass, the most stupid of all animals, when she spoke, confounded Balaam, the wisest of the wise.
Why the Talking Donkey Died the Moment It Finished Speaking
Legends of the Jews 6:23