This is because the refractive index of the glass remains the same. Light entering the glass is bent at an angle and the angle is reversed when the light leaves the glass. Therefore, while the light leaving the glass will not be in straight line with the light entering the glass, both light beams will be parallel to each other.