Oio,
M4 brings the power of an assualt rifle to close quorters battle, while not quite so accurate or powerful.
submachineguns are weaker than carbines and has less range, also less penetration power (although that wouldnt matter too much against unarmoured 'terrorists' in iraq)
Pistol lacks automatic (those which doesnt, are horribly inaccurate on auto) and power, besides becoming quite inaccurate at range.
Then what comes to the close quorters, it can also mean short distances and not just some room to room fightning.
Submachinegun would be great indoors, but in Iraq you need the gun to be capable of fightning outside as well, where the ranges can get longer than SMG is capable of.
So you give the soldier an M4 carbine and they can use it indoors and outdoors in the most common combat situation in Iraq.
Another thing is that carbines uses same ammo as full lenght rifles.
So you can equip a squad with M16's and M4's, then they can distribute ammo like they want, since both guns accepts same ammo and magazines.