That is quite a broad question to throw up, why do women get raped during wars? There is no way one could give an accurate answer to that. Also kind and good men in their own countries being cruel to others in other countries? For me they were never that kind or good in the first place, but again that is quite difficult to answer.
Some people would argue that army guys "want to have a little fun", or that its peer pressure, but as I've mentioned above I believe those kind of people originally had that kind of twisted personality in the first place and of course I don't think the excuse "having a little fun" needs an explanation of its absurdity. Of course joining something like the army or witnessing all the horrible things around you during war time can change a person in numerous ways I can imagine.
Also you mentioned that they might do it to hurt the men of that country? Well it could be like they were ordered to do things to damage the morale or whatever of that country as a whole, but whether that order included rape, encouraged rape or whatever is something I have no idea about.