Integrating each side of an equation w.r.t. to a different variable?

This is often a bit subtle to people beginning differential equations, but in reality you are just applying integration by substitution. Recall that for integration by substitution we have $$\int_{x_0}^{x_1} f(u(x))u'(x)\ dx = \int_{u(x_0)}^{u(x_1)} f(u)\ du$$ We can write this in the more familiar Leibniz notation, abbreviating $u(x_i)$ as $u_i$, in the following form $$\int_{x_0}^{x_1} f(u(x))\frac{du}{dx}\ dx = \int_{u_0}^{u_1} f(u)\ du$$ If we apply this to the differential equation $$\frac{dy}{dt} = a$$ then we integrate both sides with respect to $t$ $$\int_{t_0}^{t_1}1 \frac{dy}{dt}\ dt = \int_{t_0}^{t_1} a\ dt$$ You can recognize the left-hand side from the integration by subsitution equation with $f(y) = 1$. We therefore have $$\int_{y(t_0)}^{y(t_1)}1\ dy=\int_{y_0}^{y_1}dy$$ And this gives the illusion of integration with respect to different variables. In the end, it's just a clever mnemonic. If you keep this process in mind, it really is more intuitive to just manipulate the differentials however, so there's really nothing wrong with what you did (and I'm sure we all do it anyways). Just make sure you understand the underlying mechanics behind the separation of variables.

As James S. Cook kindly points out, all of these results are pretty much the chain rule in disguise. Many results in calculus involving change of variables or reparametrization can be traced back in origin to the chain rule. If you are not aware of the connections between the chain rule and integration by substitution, then I would say you have quite a bit of exploring to do. The wikipedia page linked above should start you off quite nicely.