Why do 0v have to be connected when using two power supplies and ULN2803A?
Just because two different supplies both have a terminal labeled 'ground' doesn't necessarily mean that those nodes are at the same voltage. In fact, if you have two supplies that have isolated output, you could have almost any potential between their ground lugs, unless you strap them together. You could find a DC offset or even significant AC between the grounds of two isolated supplies. To establish a proper relative voltage levels within your system, each component needs to have a common voltage reference, and usually that's the ground node, so you connect them for that purpose.