Why do we assume, in dimensional analysis, that the remaining constant is dimensionless?
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.
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.
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.