TL;DR: There exists no evidence that this actually happened, and there only exists thin circumstantial evidence that it did NOT happen (in the form of plausible alternate origin of the story).
There is no evidence of any truth in the legend, or that it is very old. The first mention of the Monkey is in the mid 19th Century, when Ned Corvan, a famous Geordie comic singer and songwriter, first performed the 'Monkey Song'.
Corvan toured from North Yorkshire to the Scottish lowlands. About this time he may have come into contact with the song 'And the Boddamers hung the Monkey O', a song about the villagers of the seaside village of Boddam near Peterhead in Scotland, who hanged a monkey because it was the only survivor from a local shipwreck and the salvage rights could only be claimed if there were no survivors from a wreck. The similarity between the choruses of the two songs is very striking.
Here is the lyrics to the monkey song for :
In former times, when war and strife
The French invasion threaten'd life
An' all was armed to the knife
The Fisherman hung the monkey O !
And here's the lyrics to the Boddamer song:
Eence a ship sailed round the coast
And a' the men in her was lost
Burrin' a monkey up a post
So the Boddamers hanged the monkey-O
A second proposed explanation (from snopes discussion thread) was that it was indeed a young frenchman sailor, and "monkey" part came from him serving in a "powder monkey" role.