The chapter does not state why the girl is dancing. The soldiers do not know, but offer their own theories; Azar says, "probably some weird ritual", and Henry Dobbins says "no, the girl just liked to dance". It is clear, though, that her dancing is a response to trauma beyond understanding, as she dances in the smoke and ruins of her destroyed hamlet, the bodies of her small family nearby. The girl's dancing allows her to transcend the devastation around her, at least temporarily - she dances in a world of her own, sometimes "smiling to herself", and with "a dreamy look, quiet and composed". An element of escapism is evidenced when she covers her ears as the bodies of an infant and an old lady are dragged out of the house. Although it might have seemed more logical if she covered her eyes instead of her ears at this point, still, her action definitely shows a blocking out from her senses some of the utter horror around her.
I don't think the author meant for the reader to know exactly why the girl was dancing. What he did appear to want to communicate was the fact grasped by Henry Dobbins, that her dancing was something to be respected. Everything in her life had been taken from her, and there was nothing she could do to rectify it. She should have been allowed at least this, her inexplicable dancing, pathetic but beautiful, as a final expression of her dignity and humanity (Chapter 14).