The Torah cautions us in several places not to forge treaties with the idolatrous inhabitants of Canaan. One such warning is in verse 34:12. Here it gives a reason for this ban: if we get complacent with them, we’ll end up eating from their sacrifices, which we are not to do.
We’ve already seen, in Mitzvah #26, that idolatry is prohibited. That’s a serious sin. Nothing could be a bigger metaphorical “slap in the face” to God than serving a false “god.” This is one more way in which we are warned off from getting anywhere near that trap. Accordingly, anything used in the worship of an idol, even something seemingly insignificant like water or salt, is prohibited for use.
This mitzvah is elaborated upon in parshas Haazinu. Speaking of idols, the Torah says, “the fat of whose offerings they ate, they drank the wine of whose libations” (Deut. 32:38). We see that the Torah equates the meat of idolatrous offerings and the wine of idolatrous libations in this regard.
This mitzvah may seem obscure, but it is actually quite relevant and has repercussions for us today. The practice of using yayin mevushal, wine that is cooked above a certain temperature, is because boiling wine renders it unfit for sacramental purposes (and therefore obviates the possibility of it being used for the service of idols). The controversy in 2005 about human-hair shaitels imported from India was also based on this mitzvah; it came to people’s attention that the hair used for these wigs was tonsured by women coming as pilgrims to a Hindu temple and there was concern that this would render the shaitels unfit for use. (While we cannot go into full details of this case here, it would seem that the hair was not used as an offering and, according to many authorities, such wigs are approved for use. Consult with your own rabbi for direction on this matter.)
As seen from these contemporary situations, this prohibition applies to both men and women in all times and places. This mitzvah is discussed in the Talmudic tractates of Avodah Zara, on pages 29b-32a and elsewhere. It is codified in the Shulchan Aruch in Yoreh Deah 133. It is #194 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos (who focuses on the aspect of wine) and #15 of the 194 negative mitzvos that can be fulfilled today as listed in the Chofetz Chaim’s Sefer HaMitzvos HaKatzar.