Refer figure (a) : It forms a closed loop and the current completes the loop. Therefore, net force on the loop in uniform field should be zero.
Refer figure (b) : In this case although it forms a closed loop, but current does not complete the loop. Hence, net force is not zero.