Islam before nationalism? Ok, let's take a hypothetical situation:
Let's say that the Islamic Army of Pak is fighting a war with India. Suddenly there is a threat to Islam in Saudi Arabia
That hypothetical situation is too hypothetical-ly.
Take a more probable situation where India and Pakistan are fighting a war, and there are war cries from one side "allaha hu akbarrr", suddenly there is a warcry from the other side "allaha hu akbarr". Soldiers from both sides are confused..they wonder.. are they our own people?
Now the scope of this 'our own' can be as wide as you want it to be. It can be tactical, it can be philosophical. It could mean 'soldiers from our army' or 'members of my religion who happen to be carrying a different passport'. At that moment of genius, it takes only a few seconds for someone to think "well..this is bullshit, why are we killing our own people? and for what? these borders are made by a capitalist exercise anyway, and the ruling elites are not Muslim. Why should I kill another Muslim to protect a national order which has a Hindu PM". Not a highly sophisticated thought, but then, all the more likely to occur to a Muslim brain.
What is the guarantee that such a soldier will then remain loyal to his land, over and above his ideology?
Ideology is all pervasive. No amount of discipline wipes out indoctrination one receives from their childhood. Soldiers aren't robots, they are made of flesh and blood and emotions. You probably know better than me, the instances of mutinies in various armies the world over and their causes (Soviet defections during Afghanistan campaign is a good case study). It's a very real possibility.
Us kaffirs have a limited understanding of Islam. In the way Islam is defined, it is less like a philosophy (any-ism) and more like a political system (in league with Communism) with rules prescribed for domestic governance, subject-state relations, taxation, foreign relations. When a person says 'I am a Muslim', he's not just saying that he believes in the oneness of god, but also that he believes in a political system of organizing people and running the country's affairs in a certain way. If you expect him to die for an alternate political system, you are pushing him against his base tendencies. This applies to a Pakistani soldier fighting to defend democracy in Pakistan as well.
Islam, is personal identity, combined with spiritual identity, combined with national identity, all in one. There are already reports that Pakistani army is facing a discipline problem because of jihadi commanders. There was an incident where a Pakistani Navy person tried to take over reins of his ship to strike a US ship with missiles.
5 Navy Officers Sentenced to Death in Pakistan for Trying to Attack US Warship
Their nationalism is under strain. If a Muslim in a Muslim Republic cannot remain loyal to his own Muslim nation, one cannot expect a Muslim in an Indian Republic to be loyal to a secular constitution.