Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:16:8

And ˹He created˺ the horses, mules and donkeys for you to ride and ˹as˺ adornment. And He creates that which you do not know.  

And, He created, horses and mules and asses, that you may ride them, and for adornment (wa-zīnatan is an object denoting reason; the use of both of these reasons ˹‘to ride’ and ‘for adornment’˺ as illustrations of ˹God’s˺ graces does not preclude that they may have been created for other purposes, such as for consumption in the case of horses — which is established ˹as lawful˺ by a hadīth in both Sahīhs ˹of Bukhārī and Muslim˺); and He creates what you do not know, of marvelous and strange things.
القرآن:١٦:٨

وَالْخَيْلَ وَالْبِغَالَ وَالْحَمِيرَ لِتَرْكَبُوهَا وَزِينَةً ۚ وَيَخْلُقُ مَا لَا تَعْلَمُونَ  

{و} خلق {الخيل والبغال والحمير لتركبوها وزينة} مفعول له، والتعليل بهما بتعريف النعم لا ينافي خلقها لغير ذلك كالأكل في الخيل، الثابت بحديث الصحيحين {ويخلق ما لا تعلمون} من الأشياء العجيبة الغريبة.