How does a hydrogen atom have so many spectral lines when it only has one electron?

That one electron can occupy many, many different energy levels.