Why did Curiosity perform TCM (Trajectory Correction Maneuver)s 1 through 5? 6 makes sense since it needed to adjust course to actually once in the SOI, but the others don't. I understand that this was to make sure that it arrived at Mars. But, why didn't the initial burn just place it into a Mars encountering orbit.
We try, but our ability to model reality isn't perfect. In fact, we don't even know the gravitational constant $G$ to more than 4 significant digits. Our data on the masses of the sun and the planets is similarly poor, we actually have better measurements of $G*m$ than we do of either $G$ or $m$ separately, and we use those measurements instead of their estimated masses and our imprecise value for $G$. (In fact, we call $G*m$ the "standard gravitational parameter" and have a standard symbol for it, $\mu$.)
The planets themselves have complicated mass distributions rather than existing as mathematically simple objects. Earth isn't a sphere, it's flattened by its rotation and has density variations due to its continents, oceans, structures within its mantle, etc. These are mainly an issue for objects staying in orbit for a long duration, but can have measurable effects on a departing spacecraft. The sun has effects other than gravity. The solar wind is one, but the pressure of sunlight is actually far stronger. Similarly, radiation of heat and outgassing from the spacecraft can throw the trajectory off. And there's other sources of error that may or may not be significant enough to bother modeling, or may just be too poorly known or intractable to bother doing so.
Finally, we might want a burn of exactly 1 newton for precisely 30 seconds, but real-world hardware isn't going to cooperate. Valve open/close timings are going to vary, the fluids are going to mix and ignite slightly differently each time, the propellant densities are going to change with temperature, residues and wear on the injectors and nozzle will slightly change performance.
So, between our imperfect data and our imperfect ability to maneuver the spacecraft, we have to monitor the trajectory and possibly take actions to correct it. While imperfect, our ability to model trajectories and make our spacecraft follow them are actually pretty good, and we don't always need to make any change, but we still plan ahead to make sure we can do them.
The first trajectory course maneuver, and oftentimes, the first two TCMs, are absolutely essential given NASA's planetary protection protocols. Trajectories toward Mars are designed so that there is almost zero chance of the upper stage hitting Mars in the next hundred years or so. The launch plus upper stage actions for a spacecraft intended to go to Mars intentionally target missing Mars by more than a bit. The first TCM (and oftentimes the first two TCMs) correct for the intentional miss by the upper stage.
The next TCM is needed to correct for errors in those first necessary TCMs. TCMs are commanded to start at a particular point in spacecraft clock time with the spacecraft pointing in a specific direction, and to either burn for a specified period of time or until the flight software determines that accelerometer readings have achieved the desired delta-V.
Spacecraft clocks drift, so the timing of the start of a TCM is never perfect. Accelerometers are subject to multiple error sources, so the accumulated delta-V is never perfect. For the few spacecraft that still use timed burns, that's even less than perfect. Even with modern star trackers, spacecraft pointing is not perfect. And NASA's ability to predict also of course is not perfect.
Knowing this lack of perfection has resulted in NASA designing in multiple TCMs. That the vehicles perform very close to perfection has resulted in NASA waiving off some of the non-essential TCMs in several recent flights to Mars. Keep in mind that the first one or two TCMs are essential.