One of the main reasons is that the flight is shown first in the computer reservations systems. Connecting flights are listed after the direct flights.
Another reason is that it is convenient for passengers not to have to change planes.
Definition: A direct flight, in USA terminology, is a flight that does not change either the flight number or the aircraft enroute. In most of the rest of the world, a direct flight is the same thing as a nonstop flight. They use thru flight to indicate a flight that we call a direct flight.
SWA9999, a Boeing 737, flies DAL-OKC-TUL. Passengers originating in DAL and going to OKC are on a nonstop flight. Passengers starting in DAL and going to TUL are on a direct flight.
Delta was infamous - and they may still be - for having many flights to, for example, LGW from many cities in the USA. They all routed through ATL. Closer examination revealed that they actually only had one flight to LGW, however. Here’s how it worked (fictitious flight numbers)
DAL1: ATL-LGW (aircraft: L-1011)
DAL11: CHS-ATL-LGW (aircraft from CHS to ATL was a DC-9 and ATL-LGW an L-1011)
DAL21: MEM-ATL-LGW (aircraft from MEM to ATL was a DC-8 and ATL-LGW an L-1011)
However, flights 11 and 21 actually connected to flight 1. Because they didn’t have a change of flight number even though the aircraft changed, they were considered direct flights and thus listed first in the computer reservations systems.
Clear as mud, eh?