I think I heard at the time that she was rather cornered by the people she was going to see. There was maybe a local tradition of getting political and community leaders to dance on occasion, and they just thought it might be rather fun to see how Theresa May would respond.
She could have looked even worse if she had stood stock still with everyone around her dancing.