From Dennis R. MacDonald:
Jewish and Christian biblical interpreters inherited a long tradition of allegory from Greeks. The Iliad and Odyssey had become targets for exculpatory allegory already in the sixth century B.C.E., largely because of Homer’s depictions of Olympian gods as dishonest, violent, and lustful. In the allegorical view, Homer’s gods did not actually represent the Olympians the Greeks revered; instead, they were symbols of natural phenomena or human emotions. This practice of allegorical apologetics became so widespread that the Athenian philosopher Plato debunked it at length (Republic 376e-380c). Despite such critiques, the practice continued.
One of its more fascinating practitioners, Heraclitus, (a contemporary of the New Testament writers) defended allegory, saying that if Homer’s Iliad and Odyssey can’t be taken allegorically, then they must be totally “sacrilegious fables”—something that would have been hard for Greek readers to accept (Homeric Problems 1.1-2).
Heraclitus then resolved a long string of “Homeric problems” by allegorizing them, often based on forced etymologies of proper nouns. For example, he related the one-eyed Cyclops (Kuklopes) to hypoklopon, “one who steals,” to anger that steals one’s cognitive powers (Homeric Problems 70.5). Indeed, “Odysseus’s wanderings as a whole, if carefully studied, will be found to be allegorical. Homer has produced in Odysseus a sort of instrument of every virtue” (Homeric Problems 70.1-2). Rather than taking Odysseus’s adventures as mere titillation, they become an allegory for moral development.
In the third century B.C.E. Alexandria became the center of Homeric scholarship; the translation of Jewish Scriptures into Greek (creating the Septuagint) took place there at about the same time and was subject to the same philological and exegetical scrutiny. Just as Homer suffered at the hands of allegorists, Moses did too.
In the middle of the second century B.C.E. an Egyptian Jewish intellectual named Aristobulus, who was profoundly aware of affinities between the writings attributed to Homer and Moses, allegorized parts of the Pentateuch. For example, he said God did not literally descend to earth at Mount Sinai; after all, God is omnipresent, with no need to “descend.” Instead, Aristobulus thought that Moses wrote this account to symbolize God’s revelation of majesty.
Philo of Alexandria, a contemporary of the apostle Paul, is our most important source for Egyptian Jewish allegory. Philo’s own allegories at first sight seem capricious, but they are more conservative and often quite sophisticated. Like Homeric commentators, he identified problems in the text and resolved them through word histories (etymologies) and other literary tools, either to harmonize the Pentateuch with Greek philosophy or to demonstrate Moses’s superiority to or affinities with the likes of Plato.