As far as I know, wars can be purely secular.
I'm not sure about the whole scope of things, but fighting for one's country on a private level (like the soldier, for instance) could easily fall under the 4th commandment, "Honor thy Father and thy Mother." This commandment is the basis for all of human civilization. Although, perhaps, our parents were tyrannical, abusive, hypocritical, etc, it is still our duty to honor them.
Likewise, the state can be seen as a result of the 4th commandment, the basis of civilization. So although the state may be masonic, evil, hypocritical, etc, it is still our duty, to some extent, to honor it within what the 4th commandment demands, which could mean fighting for it.
I suppose it really depends on the situation.