Because that electron can occupy any one of a number of different energy levels and radiates light of different wavelengths as it moves from one level to another.
Given sufficient energy, a single electron can jump to a higher energy level. There are many energy levels 'around' the hydrogen nucleus for it to jump to but, it must have that energy to reach them. The energy levels are not equally spaced out like say the steps on a staircase but are unequally spaced. Once the electron has jumped one of these levels it prefers to fall back to a lower energy level so soon as it can and in the process give the energy back in the form of a photon of light. This appears as a line in the spectrum for hydrogen. So each time an electron falls back from any one of these different energy levels it emits the light associated with that particular energy change. Electrons can also fall between energy levels before reaching their final energy state emitting a series of photons.