I'm curious about why the asteroid belt wasn't pulled by Mars's or Jupiter's gravity or formed into either moons or planets. Why did it form into an asteroid belt instead?
To start with, models predict that Jupiter would have formed rather quickly. The mass of Jupiter - even if it was not quite where it is now in the solar system - will perturb material out to a large distance. What this means is that if a planet were "trying" to form around the position of the asteroid belt today, it would not have been able to because of gravitational instabilities created by Jupiter (and to a lesser extent, Mars -- new research indicates Mars may have been the first planet to have formed, though its mass is significantly less than Jupiter's).
However, the asteroid belt then likely had several times its current mass. There is a fair amount of evidence for what I mentioned in the first sentence, the Late Heavy Bombardment (LHB), which was a period likely around 3.9 billion years ago that lasted for about 200 million years when there was a sharp spike in impacts in the inner solar system (you may see slightly different numbers for these, and in fact a talk I saw this week by a dynamicist suggested that it may have started 4.2 billion years ago and lasted for 400 million years). It's during this period that the asteroid belt would have lost a lot of its material.
Making the LHB actually happen dynamically, though, stumped a lot of people until a small group of dynamicists had a lot of drinks together in Nice, France, and came up with the idea that Jupiter and Saturn do-ce-do'ed in the early history of the solar system, coming to their currently observed positions today. The process of them moving would have pumped a lot of gravitational energy into the asteroid belt, scattering a lot of it, causing the LHB, and leaving it roughly as we observe today.
This is more than what you asked in your question, but I think it gives an important perspective and more complete picture of the situation back then. To recap, though, the basic idea is that of what others posted: the other planets that formed faster caused enough gravitational sheer to prevent a planet from forming in the asteroid belt. And, the asteroid belt today is many times smaller mass-wise to ever have accumulated into a planet, even a Mercury-sized one (despite what some people claim of it being the remnants of an exploded planet).
The original mass of the solar disk at that position in the Solar System is speculated to be about the same as Earth. Due to gravitational perturbations of Jupiter and Mars, the Asteroid Belt was too chaotic to allow a planet to fully form. Instead of relatively gentle collisions, allowing them to accrete, the impacts of planetesimals were highly energetic.
In fact, during the first few million years of formation about 99.9% of the original material was ejected, and we're left with the Asteroid Belt as it is today. Some of the asteroids were far enough out from the sun to accumulate ice, and it is thought that many bombarded the early Earth and that's how the oceans were formed.