When a unit is on patrol, they sleep whenever and wherever they can. Not knowing the exact situation, portrayed in these pix, its hard to say exactly what's going on.
From the looks of things, these guys are a lot better off, than the guys who slept in rain-filled, muddy foxholes, in WWII or the guys who were sleeping in snake- and leech infested ones in Vietnam. They appear to be warm and dry.
These sorts of pictures are put out there, with little or no explanation of the situation, in order to inflame people. Anyone, with a military background will look at those and say, "Yep, that's life in a war zone." Those pictures could very well have been taken on maneuvers, Stateside, even.