The arms swing to add leverage for your body (through the legs) to drive force to the ground and to offset rotational forces. This goes back to Newton's third law: equal and opposite reaction . . .
The arms, by themselves, do not gain momentum by swinging. They are only one part of the system.
The arms swinging in front of the body actually helps to offset rotational forces. Each stride applies a rotational force in planar view (looking down) because the force vector of the stride is not perfectly aligned with the center of mass. It is slightly to the outside. To illustrate, a stride with the right foot will push the right side of the body a little more forward than the left side of the body. Without anything else going on, this will cause the body to rotate to the left. But we can keep the overall body stable if we swing our arms to the left, because that will cause the body to rotate to the right. Adding the legs and arms together, the body stays neutral.