Numbers 25:2
1 When Israel lived in Shittim, the people began to commit sexual immorality with the daughters of Moab. 2 These women invited the people to the sacrifices of their gods; then the people ate and bowed down to their gods. 3 When Israel joined themselves to Baal Peor, the anger of the Lord flared up against Israel. 4 The Lord said to Moses, “Arrest all the leaders of the people, and hang them up before the Lord in broad daylight, so that the fierce anger of the Lord may be turned away from Israel.”
Psalm 106:28
26 So he made a solemn vow that he would make them die in the wilderness, 27 make their descendants die among the nations, and scatter them among foreign lands. 28 They worshiped Baal of Peor and ate sacrifices offered to the dead. 29 They made the Lord angry by their actions, and a plague broke out among them.
Notes and References
"... Like 1 Samuel 28:3, Psalm 106:28 and Numbers 25:2 have been taken as criticisms of death cult practices. Psalm 106:28 reads: “They yoked themselves to Baal Peor, and ate the sacrifices of the dead." Psalm 106:28 is dependent on the older passage, Numbers 25:2, which does not condemn practices associated with the dead; rather, it forbids “sacrifices of their gods.” Psalm 106:28 condemns “sacrifices of their gods,” since the dead are called elohim, “gods,” in 1 Samuel 28:3 and Isaiah 8:19. One may compare the parallelism of “Rephaim” with “gods,” and the further juxtaposition of these two terms with “gods” and “the dead,” in KTU 1.6 VI 45-49. It appears that only Psalm 107:28 and not Numbers 25:2 is pertinent to the question of practices for the dead. In its present form. Psalm 106 is generally considered to be exilic or later (see verses 40:47). To be sure, one can argue that verse 28 predates the Exile. Nonetheless, it would be difficult to argue for its pertinence for examining practices for the dead prior to the seventh century ..."
Smith, Mark S. and Elizabeth M. Bloch-Smith Death and Afterlife in Ugarit and Israel (pp. 277-284) Journal of the American Oriental Society, Vol. 108, 1988