Origin and meaning of "chaff before the wind"
Say you are a farmer, you've harvested your wheat or whatever, and you want to separate out the lightweight particles of bits of leaf, stem, etc. and leave just the grain. The lightweight particles are the chaff.
You pick a breezy day. Scoop up some of the harvest into a shallow pan and toss it gently in the air. The wind will blow off the chaff and the kernels of grain will fall back into the pan, because they're heavier than the chaff. Now you can pour the pure grain into the grain sack.
You're just using the relative density of the two materials, and the wind, to do the sorting.
Sorry, I can't help you with the religious part.
"Sift" here is a wonderful word to use because of the echoes of its meanings other than to separate. The numbering, paraphrased definitions, and examples are all directly from the OED; the commentary is mine.
2a. To make a trial of a person. "The more...the Sincere man...is Sifted, the more he is intrusted."
2b. To subject to questioning. "He multiplied his Questions, and sifted me thoroughly."
To scrutinize to get to the truth. "It is very hard to sift a Slander."
To separate from impurities. "Sift it from stones and rubbish" (from a guide on horticulture)
The word brings to mind the questioning, the final Judgment, the determination of the truth of lives, and separation of the worthy form the impure. And Satan ends up with the latter.