Why do we assume, in dimensional analysis, that the remaining constant is dimensionless? Walter Lewin's first lecture (at 22:16) analyzes the time $t$ for an apple to fall to the ground, using dimensional analysis. His reasoning goes like this:
It's natural to suppose that height of the apple to the ground ($h$), mass of the apple ($m$), and the acceleration due to gravity ($g$) may impact (pardon the pun) the time it takes for the apple to reach the ground. Then
$$t \propto h^\alpha m^\beta g^\gamma.$$
On both sides, the units must be equivalent, so
$$[T] = [L]^\alpha [M]^\beta \left[\frac{L}{T^2}\right]^\gamma = [L]^{\alpha + \gamma} [M]^\beta [T]^{-2\gamma}.$$
Therefore,
$$1 = -2\gamma, \quad \alpha + \gamma = 0, \quad \beta = 0.$$
Solving, we have
$$\gamma = -\frac{1}{2}, \quad \alpha = \frac{1}{2}, \quad \beta = 0.$$
Then we conclude $t = k\sqrt{\frac{h}{g}}$, where $k$ is some unit-less constant.
Lewin concludes that the apple falls independently of its mass, as proved in his thought experiment and verified in real-life. But I don't agree with his reasoning.
Lewin made the assumption that $k$ is unit-less. Why could he come to this conclusion? After all, some constants have units, like the gravitational constant ($G$).
Why isn't the following reasoning correct? The constant ($k$) has the unit $[M]^{-z}$; therefore, to match both sides of the equation, $\beta = z$. So indeed, the mass of the apple does impact its fall time.
 A: By accepting the presence of "acceleration due to gravity" $g$, Prof Lewin has already postulated that mass does not come into it. In other words - he has added certain knowledge about the physics of the system (namely - if there is such a thing as acceleration due to gravity, and that number is a constant, that means all things accelerate the same way. And if they accelerate the same way, there is no dependence on mass). This circumvents the question "can mass of the object affect the time to fall?".
If you want to answer that question, you CANNOT, in your dimensional analysis, assume that the answer is "no". Similarly, you cannot assume Newton's law of gravity (because if you did, you would come to the same conclusion).
This leaves you in a position of starting with a different set of possible inputs. The time to fall may depend on the mass of the earth $M$, the mass of the object $m$, the height $h$, and "something else that brings time into the equation", $X$. I call it $X$ because we don't have any information about its role. All we know is that $X$ must at least include dimensions of $T$ (with unknown power) and $L$ (because the answer has to have units of time - which we don't have right now - and can't have units of length - which we do have right now). And possibly $M$.
And that leaves us with an unsolvable mess - three equations (four, if you assume symmetry in mass) with seven unknowns (we don't know the power of X, and we don't know the relative sizes of the coefficients of $M$,$L$ and $T$ in X). Dimensional analysis doesn't always provide us with the answer to every problem - we do actually have to insert some actual physical knowledge to make progress.
If we just postulate that $G$, the gravitational constant, has "something to do with it" as well, then we have dimensions for $X$ ($L^3 M^{-1} T^{-2}$) and we are left with just four unknowns. We can first try to find the force on the apple:
$$F = k~M^a m^b G^c h^d$$
From which we get this equation:
$$ M^1 L^1 T^{-2} = k~M^a M^b L^{3c} M^{-c} T^{-2c} L^d$$
which leads to equations in $L$, $M$ and $T$:
$$T: -2 = -2c\\
M: 1 = a + b - c\\
L: 1 = 3c + d$$
Finally, we know that the force is symmetrical - so we should get the same answer when we swap $a$ and $b$, leading to a fourth equation
$$a = b$$
We can now solve this to get respectively
$$c = 1\\
d = -2\\
a = b = 1$$
In other words - we find Newton's law of gravity (to within a constant). 
And once we see that the force is proportional to the mass, we know the acceleration is constant - and then the argument can proceed normally.
A: Your example shows a fundamental idea: even though the units agree, this does not mean that the resulting equation is a law of physics. This is why physicists only 'accept' laws that have been tested experimentally.
This idea is nicely explained in the following XKCD comic:

Here, we get a more extreme example than just 'changing the units of $k$'. It turns out we could arbitrarily add different quantities to an equation, and end up with a new equation that is completely valid. This does not mean that this actually makes any sense! Your new 'law' needs to be validated with experiment, and as you can see in the comic, a single experiment may not be enough.
Dimensional analysis, then, is not used to derive new laws of physics through pure reasoning alone. Instead, your professor already knew, through whatever reason, that $t\propto h^\alpha m^\beta  g^\gamma$. Even that is already a bit of a leap of faith - there is nothing+ that keeps you from assuming $t\propto \ln h$. To quote your own post:

[...] as proved in his thought experiment and verified in real-life.

Instead, then, you should see dimensional analysis as a very useful tool, part of a larger toolset to derive certain laws and equations. For example, if you derive an equation through whatever other means, you can use dimension analysis to check whether your new equation is possible at all. Or, in the case of this professor, you may have a general idea where your equation should be going, and you can then use dimensional analysis to get a reasonable idea of the final form of that equation. (Note: this may save you in a closed-book exam one day).
+That's not actually true. There are good reasons why you will probably never see $\ln h$, but that's for some other time.
A: To do dimensional analysis, we first list all quantities that could affect a quantity of interest. It's true that this is a tricky business. You're totally right to wonder, for example, why we don't include the gravitational constant $G$, or perhaps the mass of the Earth $M$. In particular, if we include $M$, the argument immediately fails, because we can have any power of $m/M$ in the answer.
Prof. Lewin gets around this by a mild cheat. While the values of $M$ and $G$ do affect the time, we know that they only affect the result through the combination 
$$g = \frac{GM}{R_E^2}$$
where $R_E$ is the radius of the Earth. However, by assuming this, we're sort of assuming the conclusion, so it's a slight cheat.

However, besides the issue of $M$ and $G$, we can rule out other 'dimensionful constants', so the argument goes through. For example, you could say the constant $k$ could have something to do with the Planck mass, but we know it can't, because that involves $\hbar$ and quantum mechanics is irrelevant here. Similar physical reasoning can pare down the number of quantities enough without cheating in most situations. 
A: I think your objection is valid. For example, suppose we set $z = 1$, then the formula would look like
$$
t = \frac{m}{m_0} \sqrt{\frac{h}{g}}
$$
where $m$ is the mass of the apple and $m_0$ is a fundamental physical constant with units of mass. This is mathematically consistent. If this were a law of nature, it would "just" mean that we have a fundamental constant $m_0$ with units of mass. This seems weird but is not unprecedented; for example in the standard model the quark, lepton and neutrino masses are fundamental (not derived) constants with units of mass. We just don't see a lot of such non-unitless constants in classical physics.
A: To do dimensional analysis, we list all the quantities that could affect the result, and write (conventionally) the lowest power terms that make the dimensions balance on both sides of the equation. We also add a non-dimensional constant, as this analysis cannot determine the final scale.
Then we write down all possible non-dimensional combinations of  quantities, for example Reynolds Number (which in one definition is (mass.acceleration)/(dynamic viscosity.(velocity/distance).area)) and accept that our 'lowest terms' answer could be multiplied by any power of any dimensionless term. That is as far as dimensional analysis will take us.
If our intuition is good, we can use Occam's razor to hack away at the mass of irrelevant dimensionless terms. Experiment is the final arbiter of what the equation actually is, for which dimensionless terms need to be included, and will also put a value on the constant.
