Adding to @A runnigMind's answer@A runnigMind's answer:
Cremation of the body reminds that the body is not important but the Atman is. Body perishes but Atman exists eternally. This is in contrast with say Christianity where people would go to kingdom of heaven in their material bodies and hence do burial to 'put the bodies to rest' till judgement day. In Hinduism it's the atman which can attain Moksha and not the body. Body represents ego/ahankar and burning it is like letting go. This is the philosophical basis of Cremation which many sects adhere to.
Coincidentally or deliberately, cremation saves space on land. I've heard of cities running out of space to build cemeteries in the west. Ancient Hindus might or might not have had this insight.