Spontaneous CP violation in left-right symmetric gauge theories