Why a 20-bit shift register only output last 8 bits?
That Arduino digitalWrite takes in only an uint8_t as parameter for data. Everything above 0xFF your code is sending to it looks like 0. Only send 0 and 1 to it as needed, instead of 16-bit masks.