the beam of light deviates while moving from its path when it enters a glass slab due to refraction, which is caused due to the difference in the velocity of light in different medium due difference in densities.
the light does not bend if it enters at right angles because according to the Snell's law: μ=sin i/sin r
when angle of incidence is 0⇒sin 0=0
⇒sin r=0⇒ angle of refraction is ⇒0°.
So there is no shift in the path of light and the light passes through undeviated