Both the moon and Earth are rotating in an eastward motion. However, the moon's gravitational pull makes it come close to and then back away from the Earth, in an in-and-out motion. Meanwhile, Earth is spinning and rotating on its invisible axis around the sun (which takes approximately 365 days for a full revolution) and on its own axis (which takes just under a day, or 24 hours.)
The moon rotates around us and fades in and out of the Earth's gravitational pull at the same time. All of this happens in just under 28 days for one revolutionary cycle of the moon around the Earth before it starts over again. When this happens, what is seen appears to be the moon rising on the east side of Earth and setting on the west side at nearly the same time.
It is actually the Earth's motion that causes the moon to appear to rise and set, when it is really just rotating and coming closer to and farther away from the Earth. The moon does move to the east in its orbit around the Earth, but the Earth is turning to the east much faster. Thus, it is really the Earth's movement, and not the moon's, that is causing much of the appearance of the moon's movement. The simultaneous motion of the Earth and the pull of gravity appear to cause the moon to rise and set.
By the time the United States sees the moon set in the west, it is rising in the east in the other half of the world. This is because the center of the moon is not perfectly fixed on the center of earth, but is about 12,000 miles from Earth's center. Halfway around its rotation, the moon comes closer to us, and the other halfway around, it falls farther away. What we see as an up and down motion, because of the way the Earth rotates around and tilts toward the sun and away from the moon, is actually an in and out motion of the moon that takes just under 24 hours - an Earth day.