The first abdication was originally conditional. Tsar Alexander had then proposed that Napoleon be exiled to Elba. Even after the unconditional abdication, the marquis de Caulaincourt convinced Alexander to keep the proposition open. Napoleon wasn’t seen as a criminal, an upstart perhaps, but his rule was legitimate and the wars were often declared by the Coalition.
There wasn’t widespread support for Elba, and most diplomats and politicians had their own ideas on where to send him. The United States, Corsica, Sardinia, and the British fort of St. George on Beauly Firth were other possibilities. Alexander insisted on Elba as it would put him at an advantage to Austrian interests, and the other nations went along with it due to the other choices not being entirely pleasing — along with some threats from Alexander that were Napoleon not sent to Elba he would rescind his support for the Bourbons.
When Napoleon escaped, he was declared as much as an enemy of humanity and that he would banished from Europe if captured. He could, in theory, be executed. After Napoleon’s defeat at Waterloo, the Prussians stated that he would be executed if captured by them. For personal reasons, Napoleon refused to surrender to the Austrians and Russians — though they were unlikely to execute him. Napoleon made his way to Rochefort where he planned on embarking to the United States, though he delayed in doing so and the British blockaded the port in the meantime. Napoleon sent his aides to the captain of the HMS Bellerophon to see what terms he might get for surrendering to them. Captain Maitland suggested that asylum in England may be possible, but would have to clear it.
After some deliberation, Napoleon decided to surrender himself to the Bellerophon. When it arrived at Torbay, Napoleon was kept on board — an amusement for sight seers to come and see. The British government debated what to do with him. The three main figures (being the Prince Regent, Prime Minister, and Secretary of War) all hated him and previously instructed the Bourbons that they should execute him. They declared Napoleon a prisoner of war, which put Bonaparte in a grey area of legality. He couldn’t technically be a prisoner of war since Britain and France were no longer at war. Napoleon was no longer considered to even be a citizen of France. The possibility of him being tried and executed as an outlaw or pirate was raised, but then he couldn’t have been detained as a prisoner of war.
The government’s response to this scenario was to exile Napoleon to St. Helena as a retired general on half pay. Napoleon’s response to this was bewilderment and confusion, stating that if his coming aboard the Bellerophon was simply a trick to make him a prisoner, Britain had shamed itself. One of his remarks was, “They may as well call me Archbishop, for I was head of the Church as well as the army.” The Allies approved of the action, though the British Parliament later admitted that the government had no legal basis for Napoleon’s exile.
So, specifically as for why Napoleon wasn’t executed basically comes down to the unique position he was in. The concept of war criminals wasn’t yet around, and Napoleon was neither a figure that could simply be executed nor given asylum. If Napoleon had been given a *writ of habeus corpus, he could have been put on trial. However, the British government didn’t want the possibility for Napoleon to be let off, so they quickly decided to exile him. Even that was outside of their legal jurisdiction, but it caused a lot less fallout than an execution would have.
[*Napoleon technically had received a writ of habeus corpus. A sympathetic former judge came up with an excuse (an admiral failing to perform his duties) to have Napoleon appear as a witness in a trial. The writ was obtained, but Napoleon was whisked away before he could set foot on land.]