It seems to me that a lot of ancient religions were polytheistic, like the Greek pantheon of gods, why were monotheistic religions unheard of until Judaism?
To answer this question, you'd need to understand the origin of religion, something modern scholars tend not to touch with a ten foot pole.
The problem is, the origin of religion lies in pre-history. We're not sure precisely when religion begin. The earliest written records we have for religion are about 5,000 years old. The earliest religious archeological complexes, like Göbekli Tepe and Çatalhöyük, are 10,000 years old. The first intentional burials we've found (indicating some belief in life after death, some belief in transcendence) are about 100,000 years old. All we know is that in general in most non-Western and Western pre-Monotheism, sacred entities are plural. This might not take the form of an explicit pantheon, and there might be a strong sense of a single creator, as there are in many traditional North American and Sub-Saharan African religions, but it's still not the monotheistic (or dualistic) jealous Gods we start to see with Zoroastrianism, Judaism, Christianity, and Islam.
Even in these cases, monotheism isn't always "pure". The Hebrew Bible is full of examples of the 'am ha'eretz, the people of the land, still worshipping other gods (Asherah is the most obvious and famous example). One of the perennial critiques of Christianity by Muslims and Jewish apologists is that that Trinity isn't really monotheistic (I don't think it's a particularly compelling case when you look at it from inside Christian theology, but there's always the question of how much the Christian "people of the land" actually understand about the theology). Islam is staunchly monotheistic, but still has jinn. By these standards, arguably, we could say that henotheism, monoaltry, kathenotheism, etc. are like monotheism in many ways and they're more widely found.
That still doesn't explain why the sacred is most often found in the multiple, rather than the singular. Like I said, I don't know any serious modern scholar who's touched this issue because we have literally no evidence on the matter, 19th century scholars based their whole theories of religion around the question. Max Müller proposed naturism, the idea that gods were abstracted from natural phenomenon, so thunder become Thunder the god. E. B. Tylor proposed animism, his theory that man originally attributed souls, anima, to natural objects like trees and rocks and religion developed from there. Emile Durkheim proposed that totemism was the basic form of religion that all others originated from, and that totemism derives from groups being identified with names (the parrot clan, the turtle clan) and then eventually these ideas getting abstracted as society began to "worship itself".
The best theory I've come across is bicameralism by Julian Jaynes. His idea is that consciousness is a learned process based on metaphorical language and before we interpreted our brain's executive function as our inner monologue, we interpreted it as "commands from god". The idea that we could communicate with gods / spirits is a remnant from the days that we believed our own internal monologue to be coming from some universal deity. Since people's inner voices are different from one another and are a reflection of their personalities, then, comparing notes, people came to the conclusion that there must be multiple gods.
What I find fascinating is that Jaynes' theory is compatible with Scott Adams' "moist robot" hypothesis as well as with modern psychology of influence. That's certainly a point in its favor.
As yodatsracist said, the origin of religion is something that modern scholars don't really want to touch. Jaynes is pretty much as close as it gets to a psychological theory on the origin of religion.