Why are infrared LEDs used in optocouplers?
Simple, silicon devices are very sensitive to infrared light. See the wikipedia article on a photodiode, there's a graph showing that silicon photodiodes are most sensitive around 900 nm, and that is near infrared light.

Silicon devices are sensitive to visible light so the package has to block all the light.