L298 Flyback diode connects to ground
If you pull an inductance to ground (with a low side driver, the inductor's other terminal being connected to VCC) and then turn off the driver, the inductor will generate a positive spike - this forward biases the diodes (D1 or D3 in figure 6 on this datasheet) and conducts the spike into the positive supply.

But if you pull the inductor high (with a high side driver) and then turn off the driver, the inductor will generate a negative spike - this will forward bias diodes D2 or D4 and conduct the spike into the negative supply (ground).

In a bridge driver, both of these are happening (one at each terminal of the motor) so both pairs of diodes are necessary.