The crucial point is that the second factor depends on θ (since r i is supposed to reflect the relation between x i and y i that is modeled by θ).
the learner has an incentive to modify θ in a way that increases the second factor, even if this somewhat decreases the first factor on training data.