Going around the loop in either direction, if you jump across a component and encounter an increase in potential (always in accordance with labelled polarity), you add, and when you encounter a drop in potential, you subtract.
Going clockwise, starting at the bottom left, the first jump is across \$V_1\$ which incurs a rise in potential, so we add. The next jump is across \$R\$ which is a fall in potential, so we subtract \$v_R\$. Then we jump downwards across \$v_2\$, to a yet lower potential, so we subtract. Finally we traverse \$L\$, which according to the potential signs will incur a potential rise, so we add \$v_L\$.
Now that we are back where we started, we must end up at the same potential we started with, in the same way walking in a loop around town will always bring you back to the same height above sea-level, regardless of how many stairs or hills or descents we encountered on the journey. In other words, the total potential change around that loop is 0V:
$$ +v_1 -v_R -v_2 +v_L = 0 $$
Going anticlockwise, from the same start point, all the signs must be reversed:
$$ -v_L +v_2 +v_R -v_1 = 0 $$
Those two are of course the same equation. It's as if we multiplied each side by −1.
Perhaps your confusion stems from what we mean when we say "clockwise" or "anticlockwise". We are not talking about current, because that's clearly marked as clockwise. We are talking about the direction of the journey we take around the loop, and the potential changes we encounter on the way.
Update
After your comment, I noticed that the polarity signs for inductor L are not consistent with direction of current \$i\$. This would explain why the authors have the opposite sign for \$v_L\$ in their KVL expression, but this would yield the wrong sign for \$v_L\$ in their solution.
Consider the following snippet, where we have inductor current \$I\$ and potentials \$V_A\$ and \$V_B\$ at either end of the inductor:

simulate this circuit – Schematic created using CircuitLab
The correct relationship is:
$$ V_L = V_A-V_B = L\frac{dI}{dt} $$
That relationship is always true, but one must take care to be consistent with the order of the terms \$V_A\$ and \$V_B\$. With this convention, if \$V_A\$ is more positive than \$V_B\$, so that \$V_L>0\$, then \$\frac{dI}{dt}\$ is also positive, and \$I\$ will be changing to become more and more positive over time. This is the usual convention.
Given that the direction of current \$i\$ in the original schematic is explicitly and clearly marked, but inductor voltage polarity is contrary to convention, the actual relationship in your case would be:
$$ v_L = -L\frac{di}{dt} $$
I feel that this would be extremely easy to overlook, and while there may be some obscure reason for choosing that polarity for voltage across inductor L, I certainly do not advocate for this practice. Perhaps this was a deliberate "gotcha"? It certainly "got" me.
\$V_L + V_1 -V_R - V_2 = 0\$\$\endgroup\$