In the $O$ frame in time $t$,the light will travel a distance $ct$.
For an interval $t$ in the $0$ frame,time interval in $0'$ will be $t'=t/γ$. In this time interval light will move a distance of $ct'$ in the $0'$ frame.
Now as we can see $ct$ is greater than $ct'$, means distance travelled by light in the $0$ frame is more(as $t$ is greater than $t'$?)
Is this is contradiction? Ofcourse not. This is the path travelled by the photon not a stick that should get contracted along the motion.