That is strange. I can't see a reason why it would do that. Try this change:
void updateShiftRegister()
{
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, leds);
digitalWrite(latchPin, HIGH);
Serial.print("leds=");
Serial.println(leds, BIN);
}
What do you see on serial monitor?