The meat of holy sacrifices (kodshim) that touched something ritually impure was not to be consumed. The reason is that offerings are intended to be held in the highest regard. Accordingly, they may only be eaten in a state of ritual purity. To permit the sacrifices to become impure and then eat them is disgraceful for the Temple and would lower its esteem in people’s eyes.
It was forbidden to cause the meat of kodshim to become impure, but one would not be punished for doing so. Only the eating of such contaminated sacrifices would incur a penalty since the Torah specifies that they are not to be eaten. The mitzvah is stated in a section addressing free-will offerings, but it applies to other types of sacrifices as well, including flour offerings.
This mitzvah applied to both men and women everyone in Temple times. It is discussed in the Talmud in the thirteenth chapter of tractate Zevachim, particularly on page 108a. It is codified in the Mishneh Torah in the eighteenth chapter of Hilchos Pesulei HaMukdashin. It is #130 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos.