While the technical reason above is part of the problem there is a slightly more sinister version as well. A direct flight (single flight number, even if a connection and change of aircraft) historically would show up above a traditional connection in a GDS interface. So searching SAT-GUM would have always listed CO 7 first, even though it was a 737 to IAH and then a 777 on to Tokyo and a 764 continuing to Guam. Southwest generally uses this to its advantage still in terms of how it schedules flights while the other legacy carriers are getting better about avoiding it on domestic itineraries.
The EWR-SAN connection in this example is something of an exception, but UA also only has an 8a, 5p and 8p nonstop so it slightly fits in the schedule (though the 10a with a DEN connection is less total travel time).