The proper way to think about this is as follows:
$$\frac{dy}{dt} = Ky \Longleftrightarrow \frac{1}{y}\frac{dy}{dt} = K.$$
Thus
$$\frac{1}{y}\frac{dy}{dt} - K = 0.$$
However
$$\frac{1}{y}\frac{dy}{dt} = \frac{d}{dt}\log|y(t)|.$$
Thus if we integrate our equation with respect to $t$, what we find is that
$$ \int \left(\frac{d}{dt}\log|y(t)|-K\right)\,dt = C.$$
Using the fundamental theorem of calculus we get
$$ \log|y(t)| - Kt = C$$
which can be easily solved. As you see, we used the relation $\frac{1}{y}\frac{dy}{dt} = \frac{d}{dt}\log|y(t)|$ which relies on chain rule (since $y$ is a function of $t$). The symbolic manipulation your professor did (which many people do) is really just a repackaging of the chain rule. It's not rigorous since the notation $\frac{dy}{dt}$ is not meant to represent a fraction - it is merely notation adapted from $\frac{\Delta y}{\Delta x}$ representing slopes of secant lines. It is convenient notation as such calculations show (you can kind of think of it as a fraction without too many issues in $\text{1D}$).