most fish swim with a lateral movement of the spine, while mammals that returned to the sea with flexion and extension movements. with sideways movements only half the muscles of the body can deliver power to the movement, whilst in flexion and extension both sides of the spine are employed in movement which seems more efficent. Why did fish then start with lateral movement?
thank you for your time

Not really, it's still half for up and half for down, it's just different halves (dorsal/ventral) than the split used in side to side (left/right)