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, treats his partner with ease, and avoids corruption, his sleep and his waking are all rewarded. But as for the one who fights out of pride, showing off, and seeking reputation, who disobeys the leader and spreads corruption in the land, he does not return even breaking even."
عن رسول الله ﷺ أنه قال: الغزو غزوان: فأما من ابتغى وجه الله، وأطاع الإمام، وأنفق الكريمة، وياسر الشريك، واجتنب الفساد، فإن نومه ونبهه أجر كله، وأما من غزا فخرا ورياء وسمعة، وعصى الإمام، وأفسد في الأرض، فإنه لم يرجع بالكفاف.
Reported by Abu Dawud (2515), Nasai (3188, 4195), Hakim (2/85), and Bayhaqi (9/168), all through various chains from Baqiya bin Walid, who said, "Buhayr bin Saad narrated to me, from Khalid bin Madan, from Abu Bahriya, from Muaz bin Jabal," and he related it.This chain is hasan because of Baqiya bin Walid. Abu Bahriya is Abdullah bin Qays Kindi. There is disagreement regarding this chain, some mentioned Abu Bahriya, and some omitted him, but the correct version includes him, as in the narration mentioned above. See Ilal Daraqutni (6/84–85).Hakim said, "This is a sahih hadith according to the criteria of Muslim."As for his statement, "was easygoing with his companion," this comes from the term musayara, meaning leniency, that is, he was lenient with his companion and treated him with ease.And his statement, "he gains nothing" means he gains nothing for himself, and nothing is held against him, from the reward or punishment of that expedition. Rather, he returns having incurred the sin, because acts of obedience, when not accompanied by a sound inner intention, turn into acts of disobedience, and the disobedient one is sinful. So said the author of Awn.