I would have thought it would have been wired like it is in the 2nd diagram. Since diodes only allow current flowing one way, and the relay shoots back massive current once current is taken away from the coil, the diode in the 2nd diagram would take care of it, shouldn't it?
When the relay is turned on, your thinking would be correct - but it's not really helpful.
The diode is there for when the relay gets turned
off.
When a relay goes from being off to on, current flows and a magnetic field builds up in the coil that attracts the armature which operates the switching. With power being maintained, the magnetic field is maintained and the relay holds position.
What happens when power is removed from the relay, however, is quite something else.
The magnetic field now does not have an electric current to maintain it, so the magnetic filed will collapse. Building up the magnetic field is a comparatively slow process - limited by the current supplied by the circuit it is in. However a collapsing magnetic field is limited only by the physics of the situation ... and occurs very quickly. Some simple arithmetic will tell you that the faster a magnetic field changes around a conductor, the greater the potential is generated. Because of this, a relay powered by even 12V can generate hundreds or even thousands of volts when it gets turned off. It's called "Back EMF". Fortunately, the polarity of this back EMF is opposite to the supply voltage, so the reverse diode across the coil is ideal to short out the back EMF and plays no part when the relay is powered.
If you wonder about the magnitude of back EMF - just think about the ignition coil(s) in your car. They operate in the same way - "charging up" a magnetic field from 12V and then (when switched off) generating over 10KV in back EMF to zap through a spark plug... (Diesel vehicle drivers, please ignore.)