There are many reasons, such as safety and audio quality when avoiding ground loops, and avoiding electromagnetic interference.
And you can look at the issue from the cable point of view, or from the device point of view.
Basically, having a standardized safe way of how cables are wired together, it leaves the device side socket to decide how to connect to the metal parts of the connector on the cable.
First of all, the pinout for XLR connector is such that pin 1 is common audio ground reference pin, pins 2&3 are the balanced audio pins, and depending on how you want to count it, pin 4 is the connector shell.
On a device, the metal device chassis typically connects to XLR socket pin 4, so if the device is earthed via mains plug or other means, then also the connector metal shell becomes earthed via the device metal chassis. It makes sense on the device end to connect the connector metal shell to metal chassis, so it does not float unconnected so it acts as a grounded shield over the device connector where wires are not twisted.
The power supply of a device may be floating, i.e. not mains earth ground referenced, so the pin 1 common ground is for audio circuits only, it may not even be connected to the metal chassis or mains earth ground, depending on power supply design. Obviously, metal chassis being earth grounded or not, the metal chassis may be capacitively coupled to audio ground to prevent floating metal parts which is again bad for electromagnetic interference.
When the shell is grounded by the metal chassis, it allows the actual audio common ground to be connected inside the device as is best fit for a ground reference, to minimize ground loops such as in single point star fashion, instead of letting ground currents flow via device metal chassis.
Then the safety aspect. Cable has insulation, but the XLR connector is metallic, and typically you touch the metal parts when handling the connector.
If you have a cable that connects the shells of both connectors together, that is a risk of electric shock, because if you hold one end of the cable from the metal shell when connecting it, and the other end is connected to malfunctioning equipment or something causes the wire to become contact with hazardous voltages, that's dangerous. It is simply better to leave the metal shell to be not connected to the cable at all, so you would have to be touching the pins in the connector for it to be dangerous.
And that is why the pin 1, the audio common ground reference is used for the shielding of the two balanced audio wires, and the connector shell is on purpose disconnected from the cable, and the connected device defines how the shell is connected.
Sometimes, also the connector shell is made of plastic if it is irrelevant for shielding the connections inside the connector.
So that's how XLR cables for analog audio, for AES/EBU, for DMX-512, and even DIN cables for analog audio and MIDI work.