Equation $(35.170)$ has exactly the form $(25.90)$. As explained in chapter 25 the presence or absence of the counter-term is therefore irrelevant in the computation of the $S$-matrix, and pure quantum gravity is one-loop finite. This is an accident arising from the existence of the Euler-Poincaré characteristic and does not occur in higher orders.This is an accident arising from the existence of the Euler-Poincaré characteristic and does not occur in higher orders.
(Emphasis mine)
For completeness, we sketch the proof of one-loop finiteness of vacuum quantum gravity. We mainly follow 0550-3213(86)90193-8 (§3.1). A simple power-counting analysis reveals that, to one loop, the most general counter-term reads $$ \Delta S^{(1)}=\int g^{1/2}(c_1R^2+c_2R^{ab}R_{ab}+c_3R^{abcd}R_{abcd})\ \mathrm d^4x $$ for some (formally divergent) constants $c_{1,2,3}$. The first two terms vanish on-shell (in vacuum), while the third in principle does not. But, using the fact that the Euler-Poincaré characteristic is topological (i.e., its integrand is a total derivative), we may write the $c_3$ term as a function of $R^2$ and $R^{ab}R_{ab}$. This in turns means that $$ \Delta S^{(1)}\overset{\mathrm{O.S.}}=\int g^{1/2}(\text{total derivative})\ \mathrm d^4x $$ which proves the one-loop finiteness of quantum gravity (recall that topological terms are invisible to perturbation theory). It is clear that this argument fails in the presence of matter, because the on-shell fields do not satisfy $R^{ab}=0$ anymore, and therefore $\Delta S^{(1)}$ is no longer a total derivative.
In the case of two or more loops, the number of available invariants that can be constructed from the metric, and that may appear as counter-terms, is higher than in the one-loop case. Most of these invariants depend on $R^{abcd}$ rather than $R^{ab}$, and therefore they do not vanish on-shell. In fact, we have $$ \Delta S^{(2)}\overset{\mathrm{O.S.}}=c_4\int g^{1/2}R^{ab}{}_{cd}R^{cd}{}_{ef}R^{ef}{}_{ab}\ \mathrm d^4x $$ for some constant $c_4$. Here, there is no identity that relates this combination to a topological term and therefore, unless there is some fortuitous cancellation of divergences that leads to $c_4=0$, the two-loop counter-term Lagrangian is not expected to vanish on-shell. The explicit calculation proves that there is no such cancellation, and therefore quantum gravity is not two-loop finite.
To reiterate, it could have been the case that quantum gravity is renormalisable after all. The one-loop finiteness can be established by simple power-counting arguments, but no such conclusion can be reached for higher loops. Thus, the only thing we can do is to go through the tedious calculation. Once we do this, we find that quantum gravity is not finite. Oh well.