Allegorical interpretation was first developed in Greece in the third century BC to make embarassing elements in Homer and Hesiod philosophically correct. "The stories of the gods, and the writings of the poets, were not to be taken literally. Rather underneath is the secret or real meaning . . ." [Bernard Ramm, Protestant Biblical Interpretation, p. 25]. This method of interpretation spread to Alexandria, Egypt, where the Jewish scholar Philo (ca. 20 BC--AD 54) used it to demonstrate that the Septuagint was consonant with Plato and the Stoics. And from Philo it spread to the Christian church via Clement of Alexandria and Origen" (Sidney Greidanus, Preaching Christ from the Old Testament: a contemporary hermeneutical method, p. 80).
Like Philo, Clement taught that Scripture has a twofold meaning. Analogous to a human being, it has a body (literal) meaning as well as a soul (spiritual) meaning hidden behind the literal sense. Clement regarded the hidden, spiritual sense as the more important one (William Klein, Craig Blomberg, and Robert Hubbard, Introduction to Biblical Interpretation, p. 34). Clement's hermeneutics were based on the following three principles: (1) nothing is literally true which is unworthy of God; (2) no interpretation can be accepted which contradicts the Bible as a whole, and (3) literal meaning is meant to excite interest in understanding the deeper meaning (Dan McCartney and Charles Clayton, Let the Reader Understand: A Guide to Interpreting and Applying the Bible, p. 87).
Clement's most famous student, Origen, was convinced that mere literal interpretation can lead people astray. Had not Marcion rejected the Old Testament because of his literal understanding? (Greidanus, p. 83). Origen's overriding principle of interpretation was based on 2 Cor. 3:6: . . . the letter (of the law) kills, but the spirit gives life.
Preaching on the battle of Jericho (Josh 6), Origen says that "Joshua stands for Jesus, and Jericho for this world. The seven priests carrying trumpets represent Matthew, Mark, Luke, John, James, Jude and Peter. The prostitute Rahab stands for the church, which consists of sinners; and the scarlet cord which she displayed to save herself and her household from the massacre stands for the redemptive blood of Christ" (Origen's Homilies quoted in Arthur Wainwright, Beyond Biblical Criticism: Encountering Jesus in Scripture, p. 87).
While it would be anachronistic to call Origen an evangelical, his method of interpretation has been adopted by some evangelicals, especially preachers, in explaining Old Testament texts. An example is Alan Redpath in Victorious Christian Living: Studies in the Book of Joshua. The publisher's blurb says: Using the Old Testament Book of Joshua as his launching pad, Alan Redpath shows his readers how to enter God's Promised Land and enjoy victorious Christian living. As Dr. Redpath goes chapter by chapter throughout the exciting Book of Joshua, he notes that the whole land of Canaan was given to the people of Israel, but they possess only the portion they claimed.
I have personally heard sermons in which the preacher found the following spiritual truths in the book of Joshua.
(1) The Israelites represent Christian believers.
(2) The Canannites represent the enemies of the Christian, namely, the world, the flesh and the devil.
(3) God has promised success (Joshua 1:7-8) for the believer over the enemies, if he or she will be fully obedient (partial obedience is disobedience).
(4) The believer must march confidently against the enemies and do spiritual battle utilizing the sword of the Spirit, which is the Word of God.
(5) While the believer must act (he cannot be passive), it is ultimately the LORD who gives the victory.
(6) If the believer tries to defeat the enemy in his own strength (the arm of the flesh), he will be defeated (as the Israelites were at Ai).
(7) The enemies must be completely wiped out, utterly destroyed, because if even the smallest one (an infant) is allowed to survive, it will grow and develop and eventually bring about defeat to the Christian.
Lest one think that only ignorant, uninformed evangelicals resort to allegorizing the text, consider the eminent Oxford professor, Richard Swinburne. While Swinburne does not advocate allegorizing Joshua, he does interpret metaphorically Psalm 137:8-9: O Daughter of Babylon, doomed to destruction, happy is he who repays you for what you have done to us--he who seizes your infants and dashes them against the rocks (NIV). He maintains that this passage means that one who destroys (dashes) their evil inclinations through the power of Christ (the rock) will be blessed (happy)(What Does The Old Testament Mean, My Ways Are Not Your Ways: The Character of the God of the Hebrew Bible, University of Notre Dame).
What are the problems with spiritual (allegorical) interpretation of the Biblical text?
(1) There is no indication in the text itself that it should be understood as recording non-literal, non-historical events. As a matter of fact, to the contrary, often the literary genre is that of historical narrative.
(2) Once you reject the literal meaning in favor of an allegorical one, the only limit to the possible meaning of the text is the imagination of the interpreter.
(3) There is no way to adjudicate between competing allegorical interpretations, the text simply means whatever the interpreter wants it to mean with the end result that the Bible has no objective meaning.
So, does utilizing allegorical interpretation remove the moral contradictions contained in the story of the Conquest recorded in the Hebrew Bible? No, in my estimation, its just another example of grasping at straws.