A Buddhist, when dead, is most of the time cremated and not buried. Does this have to do with anything in the teachings of the Buddha? As far as I know, burying a body is more Eco-friendly than cremation. I share with you one of the best answers given by the legendary Neil deGrasse Tyson :) https://www.youtube.com/watch?v=afGkv0IT4dU
That answer in the video has a parallel in Sky burial where the body is exposed in the wilderness to be eaten by birds and animals.
That practice is unpopular (and, more to the point, illegal) in countries which don't have enough wilderness etc.
Cremation is a standard practice in India and, apparently, was the practice in the Buddha's time. The Maha-parinibbana Sutta ends with the monks telling the local society to do as they see fit (which included cremation).
I think there is a "religious" aspect to it: a Christian might believe in resurrection of the body and therefore want their body buried instead of destroyed. A Buddhist is more likely to see the body as impermanent and not-self (on the other hand Buddhists do collect relics, see e.g. here and here).
As for ecology I suppose that burial is more carbon-neutral, but it takes land, cemeteries run out of space.
To add to the answers already given, cremation was considered as the respectful way of disposing of the dead. All Buddhas and Cakkavatti kings of the past were said to be cremated. You wouldn't want a body of a virtuous being to be put underground and subject it to disrespectful situations like people walking above, animals digging up body parts, worms working on it, people/animals defecating or urinating above it etc.
Even when they are alive, you always offer high places to them as a form of respect. So the traditional Buddhists are disinclined on putting them underground for the sake of a plant since the event is about paying respect, rather than an opportunity to feed a tree.
In historic times it was a practice to wrap the body in a cloth and throw it into the forest or designated grave ward. The clothes used to wrap the body was used to stitch robes. Also the pratice of doing cemetry contemplation was based on such disposed bodies.
Creation is a more cultural evolution than being Buddhist at least in the Theravada perspective, i.e., Buddhist do not have a particular way as to bury or cremate. This pratice has come among Buddhist perhaps due to Hindu and Indian influence and customs. See: search on hindu funeral pyre
For more on this see:
burying a body is more Eco-friendly than cremation
This may not be true. It's the modern assertion that cremation is done in a crematorium using electricity and power. In ancient time people burnt it with dry leaves and twigs, those fuels used same for cooking and other works. Then the ashes from the burnt were used as fertilizers, or scattering back to the earth again.
Does this have to do with anything in the teachings of the Buddha?
I think so. If one study the Sutras carefully, Buddha was the one who most concerned with hygiene, some said toothbrush was invented by the Buddha. At that time, the Bhikhus chewed the willow twigs until became brush-like for cleaning teeth. Cremation is the best method hygiene-wise. During the Black Death, bodies were burnt to prevent the spreading. Most important, it has to be rooted in the teaching that the body is composed by the Four Greats: earth water fire and wind. Among these four, only fire can effectively and immediately disintegrating a body. Also, if one careful in studying the Sutra, in Mahayana Mahaparinirvana Sutra it recorded the Buddha burnt himself by setting out fire from his own chest. In many other Mahayana texts, it reports many occasions of accomplished Buddhists - Arhats, Ch'an Masters, burnt themselves by setting out fire from their own bodies. With all these precedents, if a Buddhist can't burn himself up when dying, he has no choice but to seek aid from external fire
One last less known factor is, when studying the Vinaya, it recorded at that time there was certain magic spell that could cause a dead body walking, or sometimes the corpse-ghost (起屍鬼) can animate a dead body. One story recorded a Bhikhu after collecting discarded clothes from the cemetery he was followed by a corpse, saying repeatedly "return my clothes", stopped at the entrance of the monastery, so the Bhikhu had to walk all the way back to the graveyard, put back the clothes, the corpse then collapsed to that very spot. This incident made the Buddha set another rule about collecting clothes from graveyard. Therefore, cremation, properly destroying the body after confirmed death, can prevent all these hassles. Of import is that, the modern hospital after confirming death immediately sending to mortuary a faulty practice. There's very good details in the Buddhist Sutras describing how a person dying, from beginning to the rest of all consecutive stages. The ancient Chinese would let the corpse sit in the hall for 7 days before burial or cremation. Burial often adopted since maybe the Daoist was quite obsessed with the immortality of the body, and the blood relations between the ancestor and offspring. That's why Fengshui was derived and inspected - another topic.