Soap is a nasty substance. As I remember from my Organic Chemistry classes, it has two ends one polar and another non-polar. Thus it should dissolve in both polar and non-polar solvents. That's the basis for its action being able to link itself to fatty molecules (non-polar) and solute them in water (polar). When your spice was contaminated with some soap it might produce those bad results as soap will probably be dissolved in the non-polar solvent possibly bringing something polar attached...
However soap problems do not end with contamination. To produce soap the only thing one needs is fat and a strong base such as lye. In extraction attempts I heard about, sometimes nasty emulsions are caused by a saponification of the fat present in the substrate with the lye. This is a complex procedure and soap is not always produced.
Now, if you have a soapy batch, here's a suggestions. Perhaps others may further help: Dissolve your spice in acidic water. Add some salt to precipitate the soap and remove it. Your freebase should be converted to salt form thus it should be soluble in water but not in a polar solvent. Add thus a polar solvent so that the remaining soap will be dissolved in it. Use lots of it for this part. Finally, separate the acidic water with the spice, add lye to turn it into freebase again and extract with naphtha or whatever you have at hand.
Hope this helps!
"The elfclowns of hyperspace are already juggling in the center ring. Hurry! Hurry!" T.M