The Messenger of Allah ﷺ only forbade the meat of sacrificial animals because of the hardship people were facing, then he later permitted it.
حدثنا أبو بكر بن أبي شيبة حدثنا وكيع عن سفيان عن عبد الرحمن بن عابس عن أبيه
إنما نهى رسول الله ﷺ عن لحوم الأضاحي لجهد الناس ثم رخص فيها
Bukhari narrated it in the Book of Foods, chapter "What the earlier generations used to store in their homes and on their journeys of food, meat, and other things," 5423, and elsewhere, and Muslim, in the Book of Asceticism and Softening of Hearts, chapter "The world is a prison for the believer and a paradise for the disbeliever," 23/2970, from the hadith of Sufyan, with variant wordings, at length and in brief.