I am asking because i think we divided by x here for whatever reason since the other side is equal to 0 and it wont affect the equation in any meaningful way.
Letting $y=ux$ we have $$\begin{align} (x-ux) dx + x(udx + x du) &= 0 \\ dx+ x du &= 0\\ \frac{dx}x+du&=0\\ \ln |x| + u &= c\\ x\ln |x|+ y &= cx. \end{align}$$
I got $x/2 = y + c$ instead
The thing I don't understand though is how this is legal, because if it is it means there is an infinite number of solutions possible as we could also multiply both sides by anything.
Yes, provided that term is non-zero.
Notice that after division by $x$, and a non-explicit integration, we had a $\ln |x|$ term which, just like $\frac{1}{x}$, is not well-defined when $x=0$.
Notice that several lines have been missed out. Going from the third to the fourth line, we had:
\begin{array}{ccc} \frac{\operatorname{d}\!x}{x} + \operatorname{d}\!u &=& 0 \\ \\ \frac{\operatorname{d}\!x}{x} &=& -\operatorname{d}\!u \\ \\ \int \frac{\operatorname{d}\!x}{x} &=& -\int \operatorname{d}\!u \\ \\ \ln|x| &=& -u + c \\ \\ \ln|x| + u &=& c \end{array}
The original question was in terms of $y$ and $y$ was swapped for $ux$. If $y=ux$ then $u=\frac{y}{x}$, so lets make the swap:
$$\ln|x| + \frac{y}{x} = c$$.
Since $x \neq 0$, we can multiply through by $x$ to give:
$$x\ln|x| + y = cx$$