The plan to avoid it was simple: the Service Module, post-separation, would perform a series of thrust maneuvers to take it safely away from the re-entry path of the Command Module. By shifting the Service Module to a significantly different trajectory, it wouldn't even re-enter at the same time as the Command Module, but would skip off the atmosphere this time. The re-entry of the Service Module should have only come much later, after performing another orbit (or set of orbits) around Earth.
But that didn't happen at all. To quote from Nancy Atkinson's book, pilot Frank A. Brown, flying about 450 miles (725 km) away from the re-entry point, reported the following:
I see the two of them, one above the other. One is the Command Module; the other is the Service Module. . . . I see the trail behind them — what a spectacle! You can see the bits flying off. Notice that the top one is almost unchanged while the bottom one is shattering into pieces. That is the disintegrating Service Module.
There was a fault in how the Service Module was configured to jettison its remaining fuel: a problem that was later discovered to have occurred aboard the prior Apollo 8 and Apollo 10 missions as well. Instead of a series of thrusters firing to move the Service Module away from the Command Module, shifting it to a different trajectory and eliminating the possibility of a collision, the way the thrusters actually fired put the entire mission at risk.
The problem was that there were two types of thrusters on board the Service Module: the Minus X RCS jets and the RCS roll jets. And while the roll jets fired in bursts in an attempt to stabilize the Service Module, the Minus X jets fired continuously.