Answer:
Different wavelengths of light also have different frequencies, so the "individual" waves of light are different.
So when you see a given spectra, you are actually watching a superposition of different light waves, and as the waves do not interact that much between them, you can see the different colors.
You can think this similarly as the case with two different sound waves, one high in pitch, and another low.
You can easily identify them, as they do not collide between them.
Now, if you are asking "why the spectrum has different colors".
This is because the levels of energy in each element are different, the outer electrons have weaker bonds, so they will emit photons with less energy (larger wavelength) and so on.
So there are multiple wavelengths because electrons with stronger and weaker bonds are jumping between states at the same time.