The 13.8 metre-long mammal was found at Portobello beach near the Rockville Hotel in Joppa on Saturday.
It was towed to Burntisland in Fife before being driven to a Scottish Marine Animal Stranding Scheme facility at Dunbar, where an examination was carried out to determine the cause of death.
Its 30-tonne body will now be disposed of as landfill at the seaside resort.
Dunbar community council chairman Stephen Bunyan said he was surprised to learn the whale had been taken to the town.
He said: “My son told me about it coming to Dunbar and we both wondered why they were bringing it here.
“But if it is going to landfill, I imagine they have brought an expert to carry out tests.
“I’ve never heard of it happening before, but I suppose it makes perfect sense. What else are you going to do with a whale?”
Teams from Police Scotland, the Scottish SPCA, Whale and Dolphin Conservation and British Divers Marine Life Rescue (BDMLR) were at the scene as crowds of onlookers gathered to see the stricken mammal.
Experts believe it died after being struck by boat propellers in deeper water, though it will be weeks before the official cause of death is confirmed.
Corinne Gordon, a marine mammal medic with BDMLR, was part of the team to examine the whale, which suffered deep cuts around its mouth and to dorsal fin.
She said: “One of our experts, Dr Andrew Brownlow, came down to carry out an examination and took samples to establish a cause of death.
“It will be quite a while before the results come back, but we believe it has been hit by propellers of a boat.
“Fully-grown male sperm whales can reach up to 20 metres, so he wasn’t a full adult.”