DS3231 AT24C32 IIC making digital outputs not work
This looks like a classical case of pin conflicts when merging several sketches. 

In this case it is hidden by the fact that TWI SDA and SCL are separate pins on the Arduino Leonardo. But they are also connected to pins 2 and 3 (not A4 and A5 as on Arduino Uno). 

Selecting other pins (latch/data) for the third shift register should help. 

Cheers.