Why does it need to firstly factorize the number n into two factors q and r( Lemma 4 in the paper,see the following)? What's the motivation. What if it doesn't do this factorization?
As Zhang himself says below his (2.8), the factorization $d=qr$, with $r$ in a suitably prescribed range, "is crucial for bounding the error terms". The reason for this is nicely explained in Section 5.2 of the Polymath8a paper (in the published version this is Section 5B).
Very briefly, Zhang's proof relies on the equidistribution of various convolution arithmetic functions in residue classes modulo $d$, where $d$ can be rather large. More precisely, equidistribution is only needed on average over $d$, so we are looking at various sums over the $d$ variable. If a factorization $d=qr$ is available for all the moduli, then the sums can be readily estimated via the triangle inequality and Cauchy-Schwarz.
In short, factoring the moduli efficiently allows one to break up the relevant sums into more manageable pieces: to a great extent this is what analytic number theory is about!