For example let us consider the force one.
$F$ is directly proprtional to $M_1$ and Force is directly proportional to M2,then we say F is directly proprtional to M1*M2,then we remove the proportionality and say (F=GM1M2/r^2)so why do we do this?
This is just a little algebra. $F$ is proportional to $m_1$ means $F=k_1 m_1$. Similarly, $F$ is proportional to $m_2$ means $F=k_2 m_2$. So we have $$k_1 m_1 = k_2 m_2$$ $$k_2 = \frac{k_1 m_1}{m_2}$$ then substituting gives $$F = \frac{k_1 m_1}{m_2} m_2 = k \ m_1 m_2$$ where $k=k_1/m_2$. A little additional algebra shows also that $k = k_2/m_1$
When we say $F$ is directly proportional to $M_1$, we mean that keeping other things/factors constant, $F$ will change by as much as $M_1$ changes.
This keeping other things/factors constant part is conveniently omitted that can sometimes cause confusion.
So, if $F$ was directly proportional to $M_1$ and $M_2$, and say, these masses change to $M_1^{'}$ and $M_2^{'}$, getting the new $F^{'}$ is actually a two-step process. First we get $F^{'}_{temp}$:
$$\begin{align}
F^{'}_{temp} &= F.\frac{M_1^{'}}{M_1}
\end{align}$$
In the above transformation, we assumed $M_2$ constant, so $F$ changed only according to how $M_1$ changed.
Now,
$$\begin{align}
F^{'} &= F^{'}_{temp}.\frac{M_2^{'}}{M_2} \\ &= F.\frac{M_1^{'}}{M_1}.\frac{M_2^{'}}{M_2}
\end{align}$$
This time, we assumed $M_1^{'}$ to be constant, so $F^{'}_{temp}$ now changed only according to $M_2$.
This gives:
$$\begin{align}
\frac{F^{'}}{F} &= \frac{M_1^{'}}{M_1}.\frac{M_2^{'}}{M_2} \\
&= \frac{M_1^{'}.M_2^{'}}{M_1.M_2}
\end{align}$$
This is nothing else but saying $F \propto M_1.M_2$.