why are you not allowed to leave a square root in the denominator of a math problem?
In many kinds of math, you are. However, in many others, it is not considered proper as it is "less simplified" in other words, uglier than having the radical in the numerator. Having it in the numerator can often make the following algabraic steps easier.