Why does an LED have to be a diode?
The existing answers miss the core of the question.

An LED needs to be a diode, specifically because the way the charge carriers recombine in the forward-biased diode junction releases the correct amount of energy to create photons in the visible range. Passing a current through a chunk of semiconductor with no diode junction in it would simply produce heat.

It's also important for efficiency that the semiconductor be a direct band gap material, so that energy is not lost to phonons (crystal vibrations &mdash; heat) rather than photons.

Regular silicon diodes emit light, too, but because the band gap is too low, the photons emitted are in the infrared range, and invisible to the eye. Also, silicon is an indirect band gap material, which greatly reduces its efficiency at producing photons at all.