Technically speaking, the Moon orbits both the Earth *and* the Sun, in much the same way that Earth orbits the Sun, but both the Earth and the Sun also orbit the center of the galaxy.
If you actually carry through the calculation, you'll find that the Sun's gravitational pull on the Moon is twice as strong as the Earth's gravitational pull on the Moon. The Moon is ultimately gravitationally bound to both objects - the Earth on a more local scale, but also the Sun on a larger scale (and again, the center of the galaxy on a much, much larger scale).
You can also see this if you trace out the Moon's path as it orbits both the Earth and the Sun. It's often simplified to look like [this](http://www.math.nus.edu.sg/aslaksen/pictures/o4.gif
), making loop-de-loops around the Earth as both travel around the Sun, but that's actually incorrect. The more accurate picture would be [this](http://www.math.nus.edu.sg/aslaksen/pictures/o400.gif
), where the Moon's path around the Sun is really a 13-sided polygon with slightly rounded edges.