The verse in question can be found 3 times in the early books of the Bible or Pentateuch. The first 2 are found in Exodus 23:19, 34:26 and the 3rd is in Deuteronomy:
“You shall not boil a young goat in its mother’s milk.”Deuteronomy 14:21
Here are some possible reasons why this law was given to the Israelites:
This verse was connected with the Passover which may indicate that this was a mystical and unacceptable practice which is considered ‘unclean’ and unwholesome. Archaeologists have discovered documents in ancient Syria (see Ugaritic texts – external link) that explain, that boiling a sacrifice of a young goat in their mother’s milk, was a pagan ritual practice of the Canaanites (Ratner, Zuckerman, 1986). This was the heathen nation that practiced so many abominable things that’s why God commanded Israel: “but you shall utterly destroy them: the Hittite and the Amorite and the Canaanite and the Perizzite and the Hivite and the Jebusite…” (Deuteronomy 20:17).
Other abominable practices that the Canaanites did in the worship of the god Moloch was to sacrifice children by having them pass through the fire and also all the works of witchcraft. The Lord utterly forbade these practices, “There shall not be found among you anyone who makes his son or his daughter pass through the fire, or one who practices witchcraft, or a soothsayer, or one who interprets omens, or a sorcerer” (Deuteronomy 18:10). God wanted to protect His people from these wicked deeds and warned His children saying, “When you come into the land which the Lord your God is giving you, you shall not learn to follow the abomination of those nations” (Deuteronomy 18:9).
In view of the relationship between mother and kid, it is horrible for a kid to be boiled in the very milk which was supposed to feed it and be its source of life. This was an evil situation. A person would have to be totally cruel to do such an inhumane thing.
The Lord called His children to be holy and pure and not defile themselves with the heathen practices: “Now therefore, if you will indeed obey My voice and keep My covenant, then you shall be a special treasure to Me above all people; for all the earth is Mine. And you shall be to Me a kingdom of priests and a holy nation.’ These are the words which you shall speak to the children of Israel” (Exodus 19:5, 6).
In His service,
RATNER, R., & ZUCKERMAN, B. (1986). “A Kid in Milk”?: New Photographs of “KTU” 1.23, Line 14*. Hebrew Union College Annual, 57, 15–60. http://www.jstor.org/stable/23507691