Gideon made an ephod from the gold earrings taken as spoil and put it in Ophrah (Judges 8:24–27). The text says all Israel played the prostitute after it there, and it became a snare to Gideon and his house (Judges 8:27).
In Judges 8:22–27, Israel asks Gideon to establish a lasting family rule because he delivered them from Midian. Gideon refuses to become a ruler and says Yahweh should rule them. Yet he requests gold earrings from the war spoil, receives a large amount, and uses it to make an ephod placed in his hometown, Ophrah. This scene comes after Gideon’s victory over Midian and the pursuit of its kings, when the story turns from battlefield success to what Israel does with that success. Earlier, Gideon has been treated as a leading deliverer, and his decisions affect not just him but the tribes around him.
The passage presents a tension between public words and practical outcomes. Israel’s leaders want stability and credit Gideon with their rescue, so they offer him a lasting family rule (verses 22–23). Gideon refuses that offer and explicitly says Israel’s true ruler should be Yahweh (verse 23). That claim is stated plainly in the text.
A careful answer keeps the immediate passage, the book's argument, and the whole-Bible storyline together, so the question is answered in context instead of as a detached idea.
Start with Judges 8:24-27, then read the surrounding section so the answer stays connected to the passage's flow.
24Gideon said to them, I would make a request of you, that you would give me every man the ear-rings of his spoil. (For they had golden ear-rings, because they were Ishmaelites.)
25They answered, We will willingly give them. They spread a garment, and did cast therein every man the ear-rings of his spoil.
26The weight of the golden ear-rings that he requested was one thousand and seven hundred [shekels] of gold, besides the crescents, and the pendants, and the purple clothing that was on the kings of Midian, and besides the chains that were about their camels` necks.
27Gideon made an ephod of it, and put it in his city, even in Ophrah: and all Israel played the prostitute after it there; and it became a snare to Gideon, and to his house.