Colonies of the social bacterium Myxococcus xanthus go through a morphological transition from a thin colony of cells to three-dimensional droplet-like fruiting bodies as a strategy to survive starvation. The biological pathways that control the decision to form a fruiting body have been studied extensively. However, the mechanical events that trigger the creation of multiple cell layers and give rise to droplet formation remain poorly understood. By measuring cell orientation, velocity, polarity, and force with cell-scale resolution, we reveal a stochastic local polar order in addition to the more obvious nematic order. Average cell velocity and active force at topological defects agree with predictions from active nematic theory, but their fluctuations are anomalously large due to polar active forces generated by the self-propelled rod-shaped cells. We find that M. xanthus cells adjust their reversal frequency to tune the magnitude of this local polar order, which in turn controls the mechanical stresses and triggers layer formation in the colonies.