In the first example, the polarity of V2 is deliberately reversed. We know the current is circulating clockwise yet they assume a different direction. Why? To point out that your assumption doesn't matter. It just results in a negative voltage. This is an important concept. Sometimes you won't really know which direction the current is flowing but Kirchhoff is there to help you out. Just make an assumption! If you are wrong, the result will be of an opposite polarity.
In 2.21a, I would start in the lower left corner and run clockwise so +20 - 2i - 3i = 0 or 20 = 5i or i = 4A. Then V1 = 2Ohm * 4A = 8V and V2 = 3Ohm * 4A = 12V and 8V + 12V = 20V, the original battery voltage. It all works out!
In figure 2.22, the -8V battery has polarity markings of a voltage gain in the clockwise direction (negative to positive) but the value is negative. Again, they're trying to point out that your assumption doesn't matter. You assume a gain of -8V and you wind up with a total battery voltage of 24V and a total current of 4A.