Allah T'ala says in the Holy Quran:
وَلاَ تَكُونُواْ كَالَّذِينَ خَرَجُواْ مِن دِيَارِهِم بَطَرًا وَرِئَاء النَّاسِ وَيَصُدُّونَ عَن سَبِيلِ اللّهِ وَاللّهُ بِمَا يَعْمَلُونَ مُحِيطٌ
(8:47) And be not like those who came forth from their homes exulting, with a desire to be seen of people, and hindering others from the way of Allah. Allah encompasses all that they do.
This alludes to the army of the disbelieving Qurayash, which, when it proceeded on a military expedition against the Muslims, was accompanied by singing and dancing minstrels. (See Ibn Sa'd. vol. 2, p. 13 ) Whenever the army halted, dancing and drinking parties were held. Also the army arrogantly vaunted its military power and numerical strength before the tribes and localities which fell on the way, and boasted of its invincibility. (See al-Waqidi, vol. 1, p. 39 ) This much is about the moral state of the Quraysh army. What was even worse was the object of their fighting. They were not fighting for any lofty ideal. What they aimed at was merely to defeat the forces of truth and justice, to suppress and obliterate the only group which sought to uphold the truth. They simply did not want any one to champion the cause of truth and justice.
This occasion was considered appropriate to warn the Muslims not to let themselves degenerate into a group like the Quraysh. God had favoured them with faith and devotion to the truth. And gratitude to God for this favour required that they should purify both their conduct and their reason for fighting.
This directive was not meant just for the time in which it was revealed. It is equally applicable today, and will remain applicable in all times to come. The forces of Unbelief today are no different from those in the time of the Prophet (peace he on him) for the moral state of the present-day armies is no better than of armies in the past. Arrangements for prostitution and drinking are as much a part of the present-day armies of unbelievers as ever before. The soldiers in these armies feel no shame in openly demanding the maximum amount of alcoholic drinks and as many call-girls as possible. Without any sense of shame the soldiers virtually ask their compatriots to make available to them their daughters and sisters for the gratification of their lust. That being the case how can one expect that the soldiers of today would not go about committing debauchery and polluting the life of the people in the lands which they happen to conquer?
Apart from moral corruption, the soldiers of the present-day armies are known for their arrogance and affrontery to the conquered peoples. Their gestures and conversation - both of ordinary soldiers and officers - bespeak of their arrogance. Arrogance is also reflected in the statements made by the statesmen of the militarily-strong and triumphant nations who in effect boastfully say to their people, in the words of the Quran: 'No one shall overcome you today' (al-Anfal 8: 48) and challenging the whole world in their vainglory: 'Who is greater than us in strength?' (Fusilat 41: 15).
These powers are evidently wicked, but the purposes for which they wage war are even more so. These powers are keen, out of sheer trickery, to assure the rest of the world that in waging war they are prompted only by the welfare of mankind. In actual fact, they might have either one motive for waging war or another, but it is absolutely certain that the motive is not the welfare of mankind. Their purpose is to establish their exclusive control and to exploit the resources created by God for all mankind. Their goal is to reduce other nations to the position of hewers of wood and drawers of water and to subject them to thraldom and servitude. Here Muslims are being told, in effect, that they should eschew the ways of non-Muslims and desist from devoting their lives, energy, and resources to the evil purposes for which non-Muslims engage in warfare. (Tafheemul Quran)