The idea that Genesis 6 is speaking about spirit beings emanates from the 3rd century BCE. Moses told Pharaoh the nation was Yahweh's son. Good people were God's children. The sons of God were deceived by the fair women of the heathens. The following excerpts describe the time when the world of good (Michael, Gabriel, etc.) and evil spirit beings (Belial, Azazel, Mastema, Satan, etc.) were invented, when they invented a war actually taking place in heaven(!),
-----------------------
When angels do appear in pre-Exilic texts, their function is to perform actions that would otherwise be attributed to God directly and personally. That is what would be expected of an increasingly monotheistic culture, in which writers were reluctant to involve God too directly in mundane functions. (Jenkins, Philip. Crucible of Faith: The Ancient Revolution That Made Our Modern Religious World, p. 151. Basic Books. Kindle Edition.)
In their familiar form, angels do not appear in Jewish texts that can plausibly be dated before the third century, but by about 200 BCE angelic mythology suddenly emerges fully formed in multiple texts. (Jenkins, Philip. Crucible of Faith: The Ancient Revolution That Made Our Modern Religious World, p. 150. Basic Books. Kindle Edition.)
The pioneering text for the new order was 1 Enoch, which
enumerates both good and evil angels and identifies heavenly ranks and
hierarchies. One passage in the “Book of the Watchers” lists the seven great
archangels, each with his particular area of responsibility, including the
following:
Raphael, one of the holy angels, who is over the spirits of men…
Michael, one of the holy angels, to wit, he that is set over the best part of mankind and over chaos…
Gabriel, one of the holy angels, who is over Paradise and the serpents and the Cherubim.
(Jenkins, Philip. Crucible of Faith: The Ancient Revolution That Made Our Modern Religious World, pp. 152-153. Basic Books. Kindle Edition.)
Surprisingly advanced theologizing about angels appears in Tobit, which was written around the same time as the earlier sections of 1 Enoch. (Jenkins, Philip. Crucible of Faith: The Ancient Revolution That Made Our Modern Religious World, p. 153. Basic Books. Kindle Edition.
In the century or so after the Maccabean revolt …, spiritual
forces were personified in images that now occupied center stage in the
religious narrative. Hell, Darkness, and the Devil now dominated religious
thought, as they absolutely had not in the literature of the canonical Old
Testament. (Jenkins, Philip. Crucible of Faith: The Ancient Revolution That
Made Our Modern Religious World, p. 149. Basic Books. Kindle Edition.)
Another form of heavenly intercession [is] documented in
the second century, with the prayer for the dead advocated in 2 Maccabees.
Writers at this time were exploring the implications of a more interconnected
and hierarchical universe, which contained not just angels and demons but also
the souls of the dead. (Jenkins, Philip. Crucible of Faith: The Ancient
Revolution That Made Our Modern Religious World, p. 153. Basic Books. Kindle
Edition.)
Originally, the name Azazel was part of the ancient scapegoat ritual, by which the community selected goats to be sacrificed or exiled in order to carry away the sins of the community. These were to be consigned to “absolute removal,” the word that became “Azazel.” Eventually, that word became the personal name of a mighty archdemon, as in 1 Enoch. Originally, too, Belial likewise represented a title or quality, in this case “Without Worth.” Concepts evolved into persons, who in turn became characters in a rapidly emerging mythology. (Jenkins, Philip. Crucible of Faith: The Ancient Revolution That Made Our Modern Religious World, p. 153. Basic Books. Kindle Edition.)