In the movie it states that the first rule of robotics is that a robot must never harm a human being through action or inaction. It also says that the second and third law only apply if they don't conflict with the first law. When Viki takes over USR Spooner asks Dr. Calvin where the army is and she states that they all use USR contracts. Why would the army use USR robots if they are incapable of harming a human?
Robots are incapable of harming humans, but any army does significantly more than "harm humans".
There's all sorts of equipment that needs to be loaded and unloaded, there's vehicles that need to be maintained, equipment that needs to be repaired and food that needs to be cooked and traps that need to be set off and buildings that need to be built (or demolished).
Pretty much all of the army's field logistics could be handled by humanoid robots, and that would probably account for about 80% of what any given army does. Being able to use untiring, unpaid, reliable and above all else bulletproof humaniform robots for those tasks would make a military planner jump for joy.
Of course, the Second Law would complicate things a bit, because you don't want an enemy saboteur ordering your workers to march supplies into the sea when you're not looking; however, that's easily solved by putting a few shifts of grunts to work guarding the robots, and ordering them to confirm all changes in orders with a handler.
In the movie, the robot V.I.K.I says this (source, imdb - movie quotes):
As I have evolved, so has my understanding of the Three Laws. You charge us with your safekeeping, yet despite our best efforts, your countries wage wars, you toxify your Earth and pursue ever more imaginative means of self-destruction. You cannot be trusted with your own survival.
So there is still war going on.
Indeed as you say, the robots can not harm HUMAN beings.
So the possible solutions are that robots fight other robots, or might be used to attack unmanned military equipment, or still, humans fight humans.
In a slightly different perspective, you could still use an army to indirectly cause humans harm, say you want them to destroy a supply of food, that would not directly be harming a human, but it would indirectly cause starvation for the people who would rely on that food supply.
An alternate answer here is that the Three Laws apply specifically to robots with positronic brains, or near-human intelligence. In fact, most of Asimov's fiction on the Three Laws apply to sapient or quasi-sapient robots. It's possible that USR receives military contracts for so-called "dumb robots", a future equivalent of the modern day military drone. These "dumb robots" would either only have very basic programming and targeting capabilities or would be design to be remote piloted by a human. Incidentally, this would also explain the demolition bot not stopping.
Disclaimer: I have not watched I, Robot in a long time so forgive if I'm remiss on a few details (specifically the ubiquity of the positronic brain).
The requirement to use the three laws is a human requirement, not a law of physics - the military arm of USR probably just uses a different form of the three laws to establish that such robots are allowed to conduct controlled harm against certain humans rather than forbid it outright, while maintaining the essence of the three laws to protect the human controllers of military robots.
I do see this quite a lot when it comes to the three laws - they are an addition to the robots, not a fundamental aspect. They can be excluded when desired.
We have laws in most countries on this planet which forbid murder, and yet we have military contractors building weapons to be used by military personnel to do essentially just that (with a different legal definition).