TheTorah lists a series of commands which Moses conveyed to the Israelites immediately after the Exodus from Egypt. These include the laws of peter chamor, the special status assigned to a male firstborn donkey, in which the owner is required to redeem the donkey by giving a sheep or goat to a priest.
The Talmud offers an explanation of why the donkey should be singled out from among all non-kosher species of animal for a special status of sanctity (Bechorot 5b). It explains that, as the Torah relates, the Jewish people left Egypt with immense wealth as they asked the Egyptians for their belongings before their departure, and the Egyptians happily complied.
At that moment in time it was donkeys which were used to haul the cargo out of Egypt, and this role served by the donkeys resulted in God assigning them a special status of sanctity.
Rabbi Joseph Chaim Sonenfeld (the founder of the Eda Charedit in Israel) writes that we learn from this passage in the Talmud that we can become sacred by extending ourselves and working hard for our fellow.