My sister explained that sometimes an extra dance number is needed in a musical to perform certain functions. In a live stage show, an extra dance number might be used to cover complicated set changes or costume changes. It might serve as a time when the ensemble gets another needed chance to perform, or it can just provide some comic relief. "Shapoopie" serves all of those roles as well as giving some plot subtext to help develop the "love" story between the main characters.