Sink current for TLP521 via 74HC595 or ULN2803A
The 74595 part as per the data sheet is meant to be run with a Vcc of +5V. In this mode the outputs are capable of sinking up to 6mA of current. 

The ULN2803A on the other hand can sink a much larger amount of current. As much as 100mA to 300mA per output.

The recommended amount of current through the LED of the TLP521 opto-coupler is 16 to 25 mA. As such you cannot connect the opto-coupler directly to the 74595 shift register and expect it to work correctly. The ULN2803A is put there to buffer the 74595.

Another advantage of using the ULN2803A is that you could replace the 74595 shift register with a 74HC595 type part operating at 3.3V and still allow the opto couplers to operate off of 5V. This level conversion is a common requirement for many modern MCUs that operate with a Vdd of 3.3V.