Why does speed of light have to be constant? My question is not about why speed of light has a particular constant value which has been sufficiently addressed in other questions on SE already. I want to know whether the fact that speed of light has to be constant is a consequence of other fundamental laws of Universe, or is it just a fundamental law itself.
My motivation for asking this question is thinking about Special Theory of Relativity. One way of understanding why time dilation and length contraction happen is to look at it from the perspective of constancy of speed of light. Alice who is on the moving source of light and Bob, a fixed observer see the speed of light as constant. In order for Alice to see the speed of light as a constant value, time slows down and length expands (in forward direction) thus keeping the speed constant. 
In the course I'm doing, the Professor tells that this constancy of speed of light could be more generally referred to as, "Principle of wave constancy". That is, the speed of any wave is a property of the medium (and thus it remains constant). So, the speed of a wave in water, for example, remains constant even if the source of the waves (say a paddle keeps moving). Frequency and wavelength may change but the speed remains constant. In a similar fashion, light is an electromagnetic wave and thus its speed is constant. And the constant speed is defined by the medium (which happens to be vaccum i.e., no medium for light). 
My questions are twofold now - 


*

*Is the above reasoning correct to explain why speed of light is constant? (i.e., thinking of it as constancy of any wave in general)

*Theoretically, could there be other waves that could travel through vaccum at a different speed? If yes, time dilation and length contraction will have to be different.


I'd appreciate it if the answer is kept non-technical (essential math is okay). More importantly, I request you to try and explain without using General Theory of Relativity. Because I'm thinking how the scientific understanding by 1905 had already knew that speed of light has to be constant.
 A: 
Is the above reasoning correct to explain why speed of light is constant? (i.e., thinking of it as constancy of any wave in general)

I would say no, although I'm sure you could argue for it if you defined you terms carefully. I just don't think it's good to put light waves and other waves on the same footing. First, light does not need a medium to travel through. Second, according to SR, light behaves much different than waves such as sound in air. I will explain.
Let's say I'm moving near but less than the speed of sound in air relative to the air itself. I emit a sound wave. Since the speed of sound is constant relative to the medium, I will practically be riding right next to this sound wave. In my own frame, I will observe the speed of my sound wave to be very slow, since I am moving just a little less faster than it.
Now let's say I take off in my spaceship near the speed of light. Then I turn on my ship's headlights. According to my own reference frame, I won't be practically riding along with the light I just emitted. I will see it move away from me at the speed of light relative to me.
And this is where SR breaks away from the behavior of sound waves. Sound waves move relative to the air they move through. Their speed is defined relative to the medium. You could argue that the medium serves as an absolute frame. But light does not have this property. There is no absolute frame we can use.

I want to know whether the fact that speed of light has to be constant is a consequence of other fundamental laws of Universe, or is it just a fundamental law itself.

This is held to be a postulate of SR, but whether or not it is a fundamental law is somewhat subjective, and the answer could change based on what we end up discovering about the universe in the future. According to SR it is a fundamental property of the universe. But maybe we will discover more that explains why this happens. Then that explanation will be the fundamental explanation of the universe.
I will note that your title question isn't answerable with physics. Nothing has to be any way. Why does mass have to warp space-time? Why does the universe have to have more than two fundamental forces? There isn't anything saying it has to be this way. But it is. 

Theoretically, could there be other waves that could travel through vaccum at a different speed?

I believe the answer here is no, but I have to admit I can't think of a good reason. Even if there was, I'm not sure it would ruin SR. I believe it would just mean that the particle associated with this wave would need to have mass, but then I'm not sure it could propagate without a medium. I'm not sure about all of this though.
A: 
I want to know whether the fact that speed of light has to be
  constant is a consequence of other fundamental laws of Universe, or is it just a fundamental law itself.

I know, I'm taking the risk of getting the mark TL;DR. But I wasn't able to say what I judge relevant using few words.
I would begin with one word you wrote: "constant". In physics it must be used with caution, since its meaning is not always the same. We can mean "constant in time", like in "energy of an isolated system is constant". Or "constant in space" like in "according to cosmological principle, matter density is constant in the Universe". Or, to come nearer to our topic: "speed of e.m. waves in vacuum is constant wrt to frequency."
Let me expand this point. When this happens, not necessarily for a
light wave but for whichever sort of wave, we say that the medium in non-dispersive. This is what your teacher meant with his "principle of wave constancy". It is a property of the medium, and does not generally hold true, for elastic waves, for sound waves (a kind of elastic waves) etc. It may hold approximately - this happens for sound waves in air - or not hold at all: think of gravity waves we see at sea surface or on a lake, on a pond...
But the principle of wave constancy brings also another meaning, which you quoted: the speed doesn't depend on the source's motion. This is really general, as far as waves are concerned. A wave is a motion of a medium (air, water, rock...) which is originated by an excitation produced by a source. But once the wave leaves the source and propagates in the medium, its behaviour becomes independent of what originated it.
A last, and totally different, meaning of "constant" you also made use of: "independent of reference frame". This meaning is of utmost importance in relativity, so much so that there is a special word you should use in place of the ubiquitous "constant". We say invariant. Speed of light in vacuum is invariant. This is what your question is about.
The above was necessary to establish some points I will rely on in the following. Now my answer can begin.

It's unavoidable to talk a little about the story of these ideas. 


*

*What is light made of? Particles or waves?

*What was known at beginning and at end of 19-th century?

*What did Maxwell teach us?


1) Nature of light concerned physicists from the very beginning of
modern physics - since 17-th century. Newton - as already recalled by @annav - adopted the particle model. But I certainly would not say that "before Maxwell, light was not considered a wave" - the opposite is true. Wave nature of light was sustained by Huygens, a contemporary (a little older) of Newton's. It was well known that a particle model encountered several difficulties; the main reason in favour was that a mechanical theory was more understandable at those times, when the theory of waves was in its infancy (but Huygens' principle should not be forgotten).
2) In later times experimental and theoretical arguments in favour of waves accumulated. Famous Young's double-slit experiment goes back to the very beginning of 19-th century. In that century, well before Maxwell's work, evidence for light as a wave became overwhelming and I dare say that in the mid-1800s no physicist believed in the particle theory. Leaving for a moment Maxwell aside, optics was a well-established branch of physics, capable of sophisticated experiments - above all I'm thinking of interferometry. Optics grounded on wave theory served in designing and building instruments (microscope, telescope, spectroscope) which were fundamental for progress of other sciences: astronomy, biology, chemistry. So, light is a kind of waves - said physicists. But waves of what? The only answer could be given was to coin a name for a substance endowed with very special properties and whose vibrations we could see as light - the ether.
3) Then Maxwell came. Around 1870 he put together all what was known about electromagnetic phenomena and made a synthesis of e.m. laws. In doing so he discovered a gap, an inconsistency - the differential form of Biot-Savart law, for magnetic field generated by an electric current, disagreed with other laws (I cannot deepen the subject - I would deviate too much from what has been asked). It is well known how Maxwell solved the problem: by inventing his displacement current - a term to be added into Biot-Savart law.
This step gave rise to "Maxwell equations" for the e.m. field as we know them today. Its relevance for present discussion is in a "side effect". Maxwell was able to show that his equations implied the existence of electromagnetic waves - something nobody had imagined before. Not just this: he computed the speed of these new waves in vacuum and saw its value fitted well with that of light speed, known from optics measurements. He concluded:

It is manifest that the velocity of light and the ratio of the units are quantities of the same order of magnitude. Neither of them can be said to be determined as yet with such a degree of accuracy as to enable us to assert that the one is greater or less than the other. It is to be hoped that, by further experiment, the relation b tween the magnitudes of the two quantities may be more accurately determined.
In the meantime our theory, which asserts that these two quantities are equal, and assigns a physical reason for this equality, is certainly not contradicted by the comparison of these results such as they are.
(Treatise, 3rd ed. 1873, vol. II p. 388)

Few years later experimental evidence for e.m. waves - not light, but of much longer wavelength - was given by Hertz. Practical applications soon arrived (wireless telegraphy - Marconi, at the turn of the century) the most impressive being sea rescue to ships in distress: e.g. Republic 1909, Titanic 1912.
Coming back to Maxwell, it must be noted that in his view e.m. waves were vibrations of a medium: the ether. At that time no physicist had doubted how to answer the question: "In which reference frame do Maxwell equations hold true? In which it is true that e.m. in vacuum (i.e., in absence of polarisable matter) do propagate with speed $c$?"
(BTW, in those times this symbol had not yet been adopted for light speed.) They all would answer: "In the rest frame of ether." Every physicist would consider obvious that in any other frame light would move at a different speed, furthermore depending on direction.
Then the problem was how to determine such frame. If Earth was moving wrt ether, optics experiments conducted on Earth would reveal that. This was the motivation of Michelson, and I would not insist on this point, to finally come to Einstein. Here there is an unsolved historical problem, as Einstein himself declared that when he wrote his famous paper (1905) he did not know of Michelson-Morley experiment, or at least it had not been his motivation. No doubt that experiment is not quoted in Einstein's paper, which in its first page gives different arguments for his universally known postulates.

And now we are near to answer your question. Einstein's two postulates are:


*

*(Principle of relativity.) Expressed in modern words, it states
that all physical laws are the same in every inertial reference frame.


Comment. You may find the same principle, in a form related to those times, in a famous page of the Dialogo sui Massimi Sistemi (Dialogue Concerning the Two Chief World Systems) here
(Page 107. Read from "Shut yourself up with some friend".)
The difference is that Galileo, when physics was in its infancy, could not talk of physical laws or of inertial frames, whereas Einstein, three centuries later, does this revolutionary step.


*(Invariance of light speed.) Light propagates in vacuum with the same speed in every inertial frame, irrespective of the source motion.


Note that Einstein's postulates imply the non-existence of ether, which raises an obvious question: if so, e.m. waves lose their medium - how can it be possible? I must leave aside the question.

Now beware: what I'm going to write is a personal view, not
necessarily shared by other physicists. I simply assert that second postulate is redundant, as it follows from first.
Let me explain. First of all note that second postulate actually
consists of two separate statements:


*

*light speed is invariant

*it is independent of source's motion. 


As to the latter, I already observed that it follows from wave
character of light. Once the wave has been emitted from its source, it "forgets" that and propagates according its law, which contains no reference to the source and its motion.
Invariance of light speed follows from first postulate if  Maxwell equations are included among accepted physical laws. It is generally stated that is not correct, because of Ignatowsky's theorem (1911). It says that using first postulate alone, together with homogeneity of space and time (i.e. invariance under space and time translations) only two possibilities exist for the trasformation law between intertial frames:


*

*Galileo's transformation

*Lorentz transformation, but with an undetermined velocity in place of $c$.


Then the limiting speed will not be $c$ but another (greater) velocity. If this were the case, Maxwell equations couldn't be exactly true but only approximately so. Up to now, no deviation from their validity has been found, but we must always leave the possibility open, as for any physical law.
Following this line of thought there is no reason however to assume the second postulate as a ground postulate of SR. It would be better to look at it as a corollary of physical laws under experimental scrutiny like many others. In my view the principle of relativity keeps a higher rank, even if I don't mean that it is exempt from possible experimental falsification, of course. But I would not delve here into a genuine epistemological discussion.
A: 
Is the above reasoning correct to explain why speed of light is constant? (i.e., thinking of it as constancy of any wave in general)

It depends on the meaning of "explain". In physics one uses mathematical models, with extra axioms called postulates, or principles ,or laws, which pick up a consistent subset of the mathematical format to fit experimental observations. These models have to be predictive of future measurements, (with no predictive power  it would just be a mathematical mapping).
Classical electromagnetic theory as given by Maxwell's equations is a perfect demonstration of this. The mathematical subset is picked up by the laws that described electricity and magnetism, before Maxwell's equations, because they fitted the data and were predictive. 
The constancy of speed of light emerges from the set of equations, which are wave equations. In this sense, as for other wave equations fitting physical observations, the constancy of the speed of light can be "explained"  as the constancy of wave propagation in a medium. In reality it is the result of the  specific observational laws which lead to the wave equations. Before Maxwell, light was not considered a wave, certainly not by Newton, they worked with optical rays.

Theoretically, could there be other waves that could travel through vaccum at a different speed? If yes, time dilation and length contraction will have to be different.

It would have to be a different mathematical format , i.e. not described by what is called a  wave equation presently. (see here also). It would have to have sinusoidal solutions, which are what waves are about, and one would have to see whether it fits data, and whether a velocity of propagation different than c appears in this theory.
A: It’s a fundamental law in the sense that it has been deduced from EM and then empirically ratified. It’s also been theoretically ratified a postereroi, by being incorporated into QED and the Standard Model. So anyone wanting to posit a varying speed of light will have a lot of explaining to do. 
Nevertheless, there are theories that posit a changing velocity of light. For example, Joao Maguiejo has come up with such a theory, called VSL (Varying Speed of Light), and earlier, John Moffat. 
The notion here is that c varied in the early cosmological epoch. One innovative explanatory feature of this theory is an alternative mechanism to explain the horizon problem of cosmology which is generally explained by inflation. (Personally, I happen to like it as it explains the horizon problem without positing an additional inflationary field).
A: I will answer the question that was asked: "In a similar fashion, light is an electromagnetic wave and thus its speed is constant. And the constant speed is defined by the medium (which happens to be vaccum i.e., no medium for light)."  "My questions are twofold now -

*

*Is the above reasoning correct to explain why speed of light is constant? (i.e., thinking of it as constancy of any wave in general)

*Theoretically, could there be other waves that could travel through vaccum at a different speed? If yes, time dilation and length contraction will have to be different."  (1)  Not correct.   For light, the speed is constant at c, even if the source and receiver are approaching each other. That it is "constant in the medium" does not mean anything about such cases.  (2) I only know of gravitational waves in vacuum.  I imagine GR wants them to be at a constant, c, but I don't know of any experiment for their speed properties.

