The experiment is viewed in two other frames: one in which the box is brought to rest and one in which the C shape is brought to rest. If lengths perpendicular to the motion expanded then the box would not fit through the hole. On the other hand if perpendicular lengths contracted then the C shape would not pass over the stationary box.
Since changing frames cannot change the experiment's outcome, i.e. that there is no collision between the box and C shape, this proves that lengths perpendicular to the motion do not change.