Herod's step-daughter shows her stuff at the King's birthday party. So impressed, Herod offers her anything her sweet, little heart wants. The king's wife Herodias convinces the dancing princess/daughter to ask for John the Baptist's head on a platter. Trapped by his own hubris, Herod has to grant her wish. Playing God never seems to work too well for the rich and powerful.
In the story of King David's procession bringing the Ark of God into David's royal city, Jerusalem, there are lessons being learned. David was so busy celebrating himself and his achievements when he started the parade that he forgot about God who made all these things happen. An incident on the road leads to a tragic death. The parade is stopped and party postponed.
In our passage, David is ready to resume, revising the focus of the event to honor God in humility and gratitude. David does a "scandalous" dance, and dismisses criticisms. To be a humble servant of God may mean throwing propriety, tradition, and status aside.
The invitation is for us to dance, too.