Did Moses teach the Hebrews that there was no compulsion in religion?
Nope.
Were the Hebrews ever instructed to purge themselves of those who not of the same faith?
Yes, repeatedly*. The Bible is the only religious text I know of that actually commands genocide:
Deuteronomy 20:16
But as for the towns of these peoples that the Lord your God is giving you as an inheritance, you must not let anything that breathes remain alive. You shall annihilate them—the Hittites and the Amorites, the Canaanites and the Perizzites, the Hivites and the Jebusites—just as the Lord your God has commanded, so that they may not teach you to do all the abhorrent things that they do for their gods, and you thus sin against the Lord your God.
In addition to this law, the book of Joshua is essentially a celebratory description of a string of genocides, in conquest of the so-called holy land. Genocides were also commanded, and celebrated, throughout the rest of the Deuteronomistic histories.
In addition to ethnic cleansing, the Bible also contains the following law:
Deuteronomy 13:6
If anyone secretly entices you—even if it is your brother, your father’s son or your mother’s son, or your own son or daughter, or the wife you embrace, or your most intimate friend—saying, ‘Let us go and worship other gods’, whom neither you nor your ancestors have known, any of the gods of the peoples that are around you, whether near you or far away from you, from one end of the earth to the other, you must not yield to or heed any such persons. Show them no pity or compassion and do not shield them. But you shall surely kill them; your own hand shall be first against them to execute them, and afterwards the hand of all the people. Stone them to death for trying to turn you away from the Lord your God.
However, Islam also punishes apostates with death, so the Bible is not unique in this respect.
Were there ever threats of punishment for the Hebrew people if they didn’t purge themselves of other faiths?
See the law immediately above. Also, Yahweh yells at/sends wrath upon leaders who fail to complete their genocides in the Dt. histories. For example, Judges 2:1. Saul is also rejected by Yahweh for failing to commit complete genocide against the Amalekites (1 Samuel 15).
*For the record, I don't think "Moses" instructed the Hebrews to do anything, because I don't think Moses actually existed. The priests and military leaders who likely wrote these books of the Bible, on the other hand....