The Messenger of Allah ﷺ said, "Military expeditions are of two kinds. As for the one who sets out seeking the face of Allah, obeys the leader, spends what is precious to him, treats his partner with ease, and avoids corruption, his sleep and his wakefulness are all reward. But as for the one who fights for show and reputation, disobeys the leader, and spreads corruption in the land, he does not even return with what offsets his sins."
أخبرنا عمرو بن عثمان قال حدثنا بقية عن بحير عن خالد عن أبي بحرية
عن رسول الله ﷺ أنه قال الغزو غزوان فأما من ابتغى وجه الله وأطاع الإمام وأنفق الكريمة وياسر الشريك واجتنب الفساد كان نومه ونبهه أجرا كله وأما من غزا رياء وسمعة وعصى الإمام وأفسد في الأرض فإنه لا يرجع بالكفاف
[Sahih] Abu Dawud narrated it in the Book of Jihad, chapter "On one who fights while seeking worldly gain," no. 2515, from the hadith of Baqiyyah through this chain. It is also found in Kubra, no. 4397. Hakim graded it sahih according to the criterion of Muslim (2/85), and Dhahabi agreed with him.Buhayr is Ibn Saad, and Khalid is Ibn Madan. Baqiyyah is Ibn Walid, and his narration from Buhayr is sahih because it comes from his book.The hadith has a daif corroborating witness in the work of Abu Qasim Ismail bin Qasim Halabi.