The waters around Mount Athos were known to be dangerous.[Note] It was here that an earlier Persian fleet met its demise during the invasion of 492 BC. According to Herodotus in his Histories (VI. 45):
Crossing over from Thasos [the Persians] travelled near the land as far as Acanthus, and putting out from there they tried to round Athos. But a great and irresistible north wind fell upon them as they sailed past and dealt very roughly with them, driving many of their ships upon Athos. It is said that about three hundred ships were lost, and more than twenty thousand men.
When Xerxes ordered the construction of the Athos canal during the Second Invasion, it was explicitly described as an effort to avoid the the same danger (VII. 23).
Since those who had earlier attempted to sail around Athos had suffered shipwreck, for about three years preparations had been underway there. Triremes were anchored off Elaeus in the Chersonese; with these for their headquarters, all sorts of men in the army were compelled by whippings to dig a canal.
From a practical perspective, then, the rationale for the canal was safety. On the other hand, Herodotus also attributed the effort to Xerxes' pride (VII. 25):
As far as I can judge by conjecture, Xerxes gave the command for this digging out of pride, wishing to display his power and leave a memorial.
Either way, the canal was not dug to reduce the travel distance required. That said, Xerxes apparently failed to understand the root causes of the danger. His fleet was mauled in essentially a repeat of the same mistake further down the line at Sepias (VII. 189).
Note: "High seas and dangerous currents are found off Mt. Athos ... but it was strong winds that initially caused the disaster. The wind in question was Boreas, a fierce northerly produced by the same juxtaposition of cold dry high pressure air over the continental interior and warmer moist low pressure air over the sea which gives rise to the violent Bora in the Adriatic ... the Persian fleet was always in danger of being blown directly onto its northeastern shore." - Morton, Jamie. The Role of the Physical Environment in Ancient Greek Seafaring. Brill, 2001.