You write "since $\tan\theta=\frac{7}{24}$", but that isn't anywhere in the solution. It says $\tan\phi=\frac{7}{24}$, but $\phi$ is not $\theta$. (I personally find this detour through a different angle more confusing than illuminating.) You may have been thrown off by $\cos\theta=\frac{24}{25}$, which might be a misprint, since there's no $\theta$ in the triangle (and there couldn't be, since $\theta$ is reflex); I suspect this was meant to say $\cos\phi=\frac{24}{25}$.
Answer to the further question why $1+\tan^2\theta=\sec^2\theta$ can't be used to determine which quadrant(s) $\theta$ is in:
Because you can't determine the sign of tanθ from an equation in which only its square occurs; the square doesn't contain any information about the sign. You seem to be slightly misusing or misunderstanding the notation $\tan\theta=\pm\frac{7}{24}$. It doesn't mean that $\theta$ can take both of those values; it only summarizes what you know from that one equation (namely that $\theta$ can only take one of those two values) but doesn't preclude the possibility that you can determine the sign from other information; in this case, from the information that the cosine is positive.