He pitied the situation of the unfortunate men at the bar; but as an example, to deter others from forsaking their duty, it was necessary that the law should take its course, in order that those engaged in the service of their country might be impressed with the conviction, that such offenders could not expect to escape the hands of justice. There were reasons for selecting the men who had been tried, as well as those who were acquitted, and, from his official knowledge of the particulars, he thought the ends of justice obtained.
The trial judge passed sentence as follows:
That you, and each of you, be taken to the place from whence you came, and thence be drawn on a hurdle to the place of execution, where you shall be hanged by the necks, but not till you are dead: that you be severally taken down, while yet alive, and your bowels taken out, and burnt before your faces; that your heads be then cut off, and your bodies cut in four quarters, to be at the king's disposal.'
On the sentence being read, the prisoners again begged for mercy before being taken to their prison cells. The records also indicate that "almost every individual in court was dissolved in tears during the melancholy scene."
The execution of the men took place on March 16, 1812 and was reported as follows:
On Monday morning William Cundell and John Smith, convicted of High Treason, for entering into the French service, in the war with France, were executed at Horsemonger Lane, London, in the presence of some thousands of spectators. Their bodies after hanging nearly 30 minutes, were taken down, and their heads cut off by the executioner, exclaiming, "behold the head of a traitor!"
In the Newgate Calendar  describes it this way:
On Monday morning, the 16th of March, 1812, at eight o'clock, these two young men were conducted from their cells to chapel, from whence, after remaining some time, they were drawn on a hurdle to the place of execution, and having with becoming fortitude ascended the scaffold, attended by the clergyman, they again spent a short period in prayer, seemingly thoroughly sensible of that fate fast approaching them. The dreadful moment having at length arrived, they were launched off, and their bodies, after hanging nearly half an hour, were taken down. The scene then, while the executioner was performing that part of the remaining sentence, in severing off their heads, and alternately with his right hand presenting each to the surrounding spectators, exclaiming, Behold the bead of a traitor!' became truly awful, and apparently dissolved in tears each individual who beheld the fate of two men, who thus, in the bloom of life, suffered death, according to the laws of their country.
1. The information in this post is taken from the entry in the Newgate Calendar.