We do this in personal wars as well. When we feel like we're in the right, we think God must be on our side. I've had people, who were clearly in the wrong, say things to me concerning the other party that had to do with God judging them and bringing about vindication for them. Many people even talk about other Christians with whom they are feuding as not being saved, displaying the idea that God's final judgment is going to befall them, simply because their deeds are not merely actions against the human party, but against God Himself.
That's why I find the episode in Joshua 5:13-15 so interesting. It reads as follows.
Now it came about when Joshua was by Jericho, that he lifted up his eyes and looked, and behold, a man was standing opposite him with his sword drawn in his hand, and Joshua went to him and said to him, "Are you for us or for our adversaries?" He said, "Neither; rather I indeed come now [as] captain of the army of the Lord." And Joshua fell on his face to the earth, and bowed down, and said to him, "What has my lord to say to his servant?" The captain of the Lord's army said to Joshua, "Remove your sandals from your feet, for the place where you are standing is holy." And Joshua did so.
I find what the "captain" (r# "prince," "ruler") of YHWH's army says to be fascinating, especially if this were just made up by one side of the conflict. Joshua asks him what side he is on, and the answer is "neither." What? Neither? I imagine Joshua may have been stunned. Certainly, the Israelite reader was. Is Israel not God's very people? Did He not just shake up an entire superpower, the Egyptians, in order to deliver Israel? Israel is the Lord's side, right? Nope.
You see, within Joshua is a literary argument that presents the true Israelite as one who follows the Lord. So even though the Israelites are commanded to Mrx "dedicate to destruction" all of the Canaanites, Rahab is spared, not because the Israelites are breaking the command, but because she is no longer a Canaanite once she places her allegiance with YHWH. Conversely, when Achan, an Israelite of Israelites, being from the royal tribe of Judah, breaks covenant with God in order to act like a Canaanite, Achan is Mrx'd, not because Israel is to be, but because he is now considered a Canaanite. This theology underlies much of the Deuteronomic history, and that is why Ruth, even though it is likely not a part of the DH, fits right into it.
What does this mean for our present topic? It means that the Lord isn't on anyone's side. The question is whether we are on His. If we are, we're on the right side. If we aren't, it doesn't matter what we identify ourselves to be (i.e., I'm a Christian so the Lord is on my side). It only matters whether we are listening to the Lord through what He has spoken and seeking to obey that, all personal vendettas thrown aside.
You see, here, God is making a point that He isn't a tribal god that you can manipulate to give strength to your side of the conflict. He doesn't join sides. He tells us to join His. He's the one in control. We cannot persuade Him to join us.
Instead, what we need to realize is that whatever is good and pleasing to the Lord, ACCORDING TO THE LORD, is on the Lord's side. I say, "according to the Lord," because history tells us that we can make anything we believe and desire into what the Lord desires too, but this is to miss the point of what is being said here. If the Israelites obey what has been commanded by God via revelation (which now resides for us in the Bible) then they are on the Lord's side. If they do not, they are not on His side, regardless of how they think of themselves or their noble causes. A man cannot judge rightly what is good and evil when we get beyond the obvious morals to all (or to most I should say), so he must intently observe what the Lord has said in order to truly know what side he is really on.
The Canaanites, in this conflict, were against the Lord. God had said that he was judging them for their gross immorality that He had patiently overlooked for hundreds of years until their sins had come to their limit. God was destroying them, then, not primarily because they were Israel's enemies, but because they were first and foremost God's. It just so happens that God works all things for the salvation of those who are on His side, and so in destroying the Canaanites, he saves the Israelites in the process; but the Israelites themselves are told that they will suffer the same fate if they do the same things the Canaanites did.
This is important for us to understand when we get into conflicts with others. God doesn't have your back in any fight. Your fight needs to be for Him. If it's for you then you can forget claiming that God is on your side, and I would definitely cease from dealing out divine judgment, which seems to be a classic way of thinking about one's enemies within the larger scale of national wars to individual communities and even within households.
Concern yourself with being on the Lord's side. Seek to be drawn into His conflict rather than to draw Him into your own. Dive into Scripture, not to justify yourself, but to be convicted as an enemy of God who needs to become His friend, join His side, and fight for His causes rather than your own. Only then, will you truly be on the Lord's side, and the wars of men be traded for the most noble of conflicts.
Put on the full armor of God, that you may be able to stand firm against the schemes of the devil. For our struggle is not against flesh and blood, but against the rulers, against the powers, against the world forces of this darkness, against the spiritual [forces] of wickedness in the heavenly [places.] Therefore, take up the full armor of God, that you may be able to resist in the evil day, and having done everything, to stand firm. (Eph 6:11-13)