J.B.
I used to have this problem a lot. I found it was worse when I used cold water. I even put the detergent in first (with the water filling) and then added clothes, but it didn't help. It was like the detergent was rinsing out of the clothes or something. I ended up switching from powdered detergent to liquid and I haven't had the problem since.