Yesh lachkor: Is a talking donkey like Bilam had still a donkey, just one with special talents, or is it a different animal entirely -- maybe we shouldn't even call it an animal at all?
The Midrash tells us that after letting it have its say Hashem killed Bilam's donkey. There are two reasons given: 1) So that people would not start worshiping this "magical" donkey; 2) For kavod habriyos of Bilam, so that people should not say this is the donkey that bested him. The Midrash compares this to the din that requires killing an animal used for znus, because so long as the animal is alive people will continue to speak of the perverted act done by Ploni with it.
The Be'er Yosef questions the comparison drawn by the Medrash. In the case of the animal used for znus, there was an aveira the animal and its master are associated with. What aveira did the donkey of Bilam do? It was doing the mitzvah of acting as Hashem's agent to speak to Bilam!
He suggests that the lesson taken from the case of znus is that the criminal suffers enough by being killed; additional embarrassment suffered after death by having the stain of the crime perpetuated by the animal remaining alive is excessive punishment. So too, as wicked as Bilam was, he suffered enough by being publicly humiliated that one time by his donkey. or the donkey to remain alive and serve as a reminder to all of what occurred is beyond the degree of punishment he deserved. Hashem metes out punishment precisely -- not one jot beyond what is deserved is given.
(According to Chazal, Bilam was actually guilty of bestiality. According to that view, the comparison to the case of znus perhaps fits in a literal sense.)
The Be'er Yosef goes on to suggest his own answer as to why the donkey had to die. Once the donkey was given the ability to speak, it simply could not go back to being a donkey. A creature that can communicate with words and express ideas doesn't belong in a barn or pulling a wagon. Better a quick death than a life like that.
Does this mean that a donkey that can speak is no longer a donkey? It is transformed into a different being and can therefore not revert to its old self?
Perhaps the Be'er Yosef does not mean the metziyus of what the donkey was changed, but rather the point is psychological. Even if the reality is that the donkey remains a donkey, psychologically such an animal will no longer be capable of simply following orders and carrying burdens like before. Once a higher dimension of reality is experienced, it becomes impossible to simply sink back to the same drudgery as before.
Perhaps this is the meaning behind the famous gemara (Nida 31) that a baby is taught the entire Torah in the womb and is then made to forget it before birth. What's the point of learning Torah only to be forced to forget it? The answer is that even if the Torah is removed, the impression of being capable of mastering Torah, the roshem of being a ben Torah, remains. Just like a donkey that experienced speech cannot simply go back to being an ordinary donkey, a neshoma that has tasted such lofty heights of Torah must inevitably be a different person out of the womb that a neshoma that has never tasted such delights.
For centuries and centuries during the upcoming weeks we have mourned the destruction of the Beis haMikdash. How and why do we keep it up? Why can't we just forget the past and move on? The answer is that once tasted, the memory of the Mikdash lingers. Just as Bilam's donkey could not simply go back to being a donkey after, once we as a a nation experienced life with a Beis haMikdash we can never forget and never go back to life without one.