This is because the projectile is under the influence of gravity which acts vertically downwards. The projectile has two components of velocities. One is vertical component $(v\cos\theta)$ and other is horizontal component $(v\sin\theta).$ The horizontal component does not change but the vertical component changes due to gravity. As the projectile motion proceeds, the vertical component goes on decreasing and becomes zero at maximum height. So, at maximum height, only horizontal component of the velocity remains. That’s why, the direction of motion of a projectile becomes horizontal at maximum height.
[Read: Projectile Motion]