The theory behind the clamping diode is explained by the following equation.
V = -L*di/dt. If you don't know calculus, in plain English it says "the voltage across an inductor is equal to the inductance (in Henrys) multiplied by the time-rate-of-change of the current through it." To show how big the votlages can get, here is a quick example. Let's assume the motor winding has an inductance of 10 mH (I'm pulling these numbers out of thin air), you are drawing a constant 0.4 Amps, and turn off the current in 100 microseconds. The result would be V = -0.010 * 0.4/0.0001 = -40 V. If the FETs in your motor driver chip are only rated to 35V of reverse-bias, then you have released the magic smoke and killed the driver.
So, to keep this turn-off transient voltage (generated by back-EMF, EMF = electromotive force, more commonly called voltage) from frying your driver, you need to clamp it to a fixed voltage level. The two readily available voltages are +Vcc2 and Ground. Since the motor in your schematic is shown to be bidirectional, the current can flow "up" or "down", through it.
Assume that we are applying a positive voltage to the top terminal of the motor, and the bottom terminal is being pulled to ground by the driver. The current will flow from top to bottom. When the motor driver turns off, the energy stored in the magnetic field of the motor windings (inductors) creates a voltage with a polarity in reverse to the direction of current flow. In this case, you will create a voltage potential from the top terminal, to the bottom terminal (visualize this by removing the motor and dropping a 40V battery in it's place). Since the top terminal is one diode-drop (0.2V or 0.7V) above ground, it will want to remain there when the top-right diode is conducting. So, the bottom of the voltage potential is at ~0.2V. The other side of the motor's induced voltage potential will be at 40.2V. If you look at the bottom terminal, 40 volts there will cause the diode on the opposite side (bottom-left) to turn on, allowing charge from the voltage potential (motor back-EMF) to flow into the +Vcc2 supply.
The same thing happens if the motor is driven in the opposite direction, except the polarity of the transient voltage will be reversed, and the oposite diodes (top-left and bottom-right) will conduct to remove the excess charge that is stored in the motor's windings at turn-off.