The bodies were buried in great haste. To my knowledge, there is no way to know exactly why.
What is peculiar in the case of the battle of Visby is that the battle took place outside of a town, but the town kept itself outside of the conflict. The townfolks had since long been in conflict with the peasants on the island and did not wish to aid them in a conflict with the Danes. It is possible that this social distance meant that the townsfolks did not care to show more respect towards the fallen than they did. Another guess is that they acted out of fear of the smell and odours from the dead. The prevalent medical theory was that disease spread through foul air, and the uneasiness must have been high just a decade after the great plague.