I also found this a bit nonrigorous at first. But to someone who is just starting out with proofs, it's likely best not to bog them down with details - going into the formalities of why we can make that assumption draws attention away from the actual proof.
Here's a way to think about this (somewhat) more rigorously. One way to define the set of rational numbers $\mathbb{Q}$ is as the set of equivalence classes of $\mathbb{Z}\times(\mathbb{Z}\setminus\{0\})$ under the equivalence relation $(a,b)\sim(c,d)\iff ad=bc$, and write a representative $(a,b)$ of this equivalence class as $\frac{a}{b}$. (If you're not familiar with this terminology, it essentially means that we define rational numbers by taking pairs of integers, then declaring two pairs $(a,b)$ and $(c,d)$ to be equal if they satisfy the relation $ad=bc$.) This is motivated by the following computation (when $b$ and $d$ are nonzero):
$$\frac{a}{b}=\frac{c}{d}\iff ad=bc.$$
Now it's easier to see why we can assume without loss of generality that $p$ and $q$ have no common factors. Suppose that $p=ap'$ and $q=aq'$ for some integers $a,p',q'$. Then we have:
$$\frac{p}{q}=\frac{ap'}{aq'}.$$
We claim that the fraction $\frac{ap'}{aq'}=\frac{p'}{q'}$; but this follows from our definition of the rational numbers, since $(ap')q'=(aq')p'$ from the commutativity of integer multiplication. So if $p$ and $q$ share a common factor $a$, then the fraction $p/q$ is equal to the fraction $p'/q'$, where the common factor of $a$ has been "divided out".
The two integers $p$ and $q$ can only share a finite number of factors (other than $1$). This is simply because an integer can itself have only finitely many factors (other than $1$). Note that if $p$ has infinitely many factors other than $1$, then you can write $p=a_1p'=a_1a_2p''=\cdots$, where each $a_j$ is strictly greater than $1$. Thus each $a_j$ is greater than or equal to $2$ (as each is an integer), and as each of $p',p'',\cdots\geq1$, we have $p\geq 2^n$ for every $n\in\mathbb{N}$, contradicting the assumption that $p$ is an integer. Thus $p$ and $q$ can only have finitely many non-$1$ factors, and so we can repeat the process above a finite number of times to cancel the finite number of shared factors of $p$ and $q$.