This looks like purple loosestrife, which is a nonnative plant, considered invasive in many states. To control spreading, cut off wilted blooms and stems as soon as possible after flowering. Cover flower and stems with a plastic bag and tie off to prevent seeds from falling on the ground.