The scenario you describe is not uncommon and there are a couple of legal/political and marketing-related reasons why it would be the case.
Cabotage/Freedoms of the Air
The airline may lack the rights to carry passengers from A-B, though they can carry them A-B-C. For example, if the segment is domestic and the airline is foreign, the airline must have rights of cabotage. Most countries prohibit foreign carriers (whether in the air, on land, or at sea) from competing with domestic carriers, the only exceptions lying within certain economic blocs such as the EU.
For example, Qantas QF108 currently flies between New York-JFK and Sydney via Los Angeles. Qantas is an Australian airline. Australia and the United States do not have a treaty that allows cabotage, so Qantas is forbidden under U.S. law from carrying passengers between points within the United States. Thus, you can book a flight on QF108 JFK-LAX-SYD, or LAX-SYD, but not JFK-LAX.
As with so much in airline pricing, there are mysterious algorithms based on historical travel patterns and revenue projections behind every fare quote. It is entirely possible, for example, that US Airways might be willing to willing to sell you DCA-PHL-MAD ticket but not DCA-PHL, perhaps trying to keep those seats open for passengers with higher revenue onward connections. Certainly, flights such DCA-PHL are priced considerably higher than one might expect based on distance or demand, in part for this reason.
There are a few more remote possibilities, like technical stops being represented as intermediate destinations, or a segment of a direct flight being unavailable for separate purchase, but I believe the above two should over most cases.