To put it more precisely:
1) The horizontal distance is proportional to the constant horizontal velocity and to the flight time.
2) Since the vertical acceleration is constant, the flight time is proportional to the initial vertical velocity.
1 + 2) The horizontal distance is proportional to the product of the horizontal and vertical velocity.
Now think of a rectangle with the sides Vx and Vy. Given a fixed diagonal V, the area Vx * Vy is maximized in the case of a square: Vx = Vy or 45° diagonal inclination.