I do not know whether the Messenger of Allah ﷺ forbade it because the donkeys were the people's means of transport and he disliked that their means of transport be lost, or whether he prohibited the flesh of domestic donkeys on the day of Khaybar.
و حدثني أحمد بن يوسف الأزدي حدثنا عمر بن حفص بن غياث حدثنا أبي عن عاصم عن عامر
لا أدري إنما نهى عنه رسول الله ﷺ من أجل أنه كان حمولة الناس فكره أن تذهب حمولتهم أو حرمه في يوم خيبر لحوم الحمر الأهلية