This is a direct consequence of two things: Hamas not wearing uniforms in combat and their tendency to use suicide bombers. They are told to undress themselves before processing - they don’t stay that way.
How would any of the people criticizing this deal with a large group of fighting age men in a war zone?