Abu Musa told that a man came to the Prophet and said, “One man fights for booty, one for the reputation of fighting, and one for his degree [of bravery] to be seen; which of them is in God’s path?” He replied, “The one who fights that God’s word may have preeminence is in God’s path.”
(Bukhari and Muslim.)