I know it was to dock with the Lunar Module, but why could the parts not be connected from the start to avoid this additional maneuver?
This maneuver was called Transposition, docking, and extraction, or TD&E for short, and the whole reason behind it was so the Saturn V's Launch Escape System (LES) didn't have to also provide thrust for the whole configuration, but only for the Command Module (CM) at the top of the stack:
Edit: Since this is already described in sufficient detail in Reasons behind the “Transposition, docking and extraction” maneuver, I'll just post one more video of how in-flight abort of Apollo looked like during the Apollo Launch Abort System Test:
Unmanned Apollo 'boilerplate' Command Module #22 was launched aboard a Little Joe II booster to test of the dynamics of an in-flight abort. Although the booster unintentionally went out of control and disintegrated - in a spectacular scene eerily reminescent of the Challenger disaster - the Launch Escape System functioned well, and the CM was recovered undamaged.