@Arvind Arul here you go, i guess
The poem conveys a very strong message that knowledge, intelligence and wisdom are extremely important for survival. The king dies due to his foolishness and the disability to understand reason. Even the people of the country were left with a melon as their king due to their unmindful behaviour. As it is an age old custom in India to 'blindly follow the leader', the people of the country didn't use their own brain to come up with the solution and instead blamed each other for their foolishness.