The permission came as an answer for this question: “Is it allowed in our days for an Israeli occupation soldier, for example, to rape girls during a fight, or is such a thing forbidden?”
“As in war the prohibition against risking your life is broken for the benefit of others, so are the prohibitions against immorality,” the rabbi said.
To make things clearer, he explained: “Wine touched by gentiles, consumption of which is prohibited in peacetime, is allowed at war, to maintain the good spirit of the warriors. Consumption of prohibited foods is permitted at war to maintain the fitness of the warriors, even though they are prohibited during peacetime.
He even went more beyond rape and said: “And since the success of the whole at war is our goal, the Torah permitted the individual to satisfy the evil urge in his soul.”