MC74HC165N + Arduino, Dunno what's the issue
Most likely the problem is caused by not having anything connected to the input pins of the 74HC165.  I did not look at the circuit closely, however, if you don't put something predictable on the input pins of any device, all kinds of strange things can happen.  All you have to do is pull up or pull down the input pins with a 10 k resistor and then the results will be predictable.  Good luck.