This superstition came about because of their association with witches in the Middle Ages. Black cats are still considered bad luck throughout most of Europe, India and the US. Many pet shelters in the US will not adopt out black cats around Halloween due to the increased risk of harm.
Not all countries think of black cats as bad luck though, Great Britain, Ireland, Japan, Australia and New Zealand all consider black cats to be good luck. A black cat who crosses your path in England is thought to be good luck. In Germany, if a black cat crosses your path from left to right, it is a good omen if it crosses from right to left it is a bad omen.