There are several approaches to vehicle positioning on traffic stops, but the most common one dictates that the police vehicle be stopped with the center line of the police vehicle lined up on the left side of the violator vehicle.
This method provides a slightly wider approach alley and adds a margin of safety if the police vehicle is struck from behind. If this happens, the police vehicle will move to the right and forward instead of just forward. This can save the officer from being crushed between the cars and the violator's car from a direct impact. This method also provides greater protection should the traffic stop devolve into a shootout. The officer will have the engine block and the front wheels between him and the shooter.
It's obviously a good idea to get as far off the road as possible, but some roads don't have a lot of room on the shoulder. Also, the position of the violator's vehicle dictates the position of the officer's car to some extent if the officer follows the suggested arrangement.
Every traffic stop is unique, and the officer doesn't always anticipate traffic problems or pick the best spot for the stop. No one gets it right every time.