The reason is history. UA entered the London market by purchasing PAN AM's authorities and therefore got the very valuable rights to fly into Heathrow - under the Bermuda II Treaty, only 2 US carriers can fly into LHR, originally that was PA and TW, now its UA and AA. At one time, National Airlines also flew into Heathrow on its services from MIA.
The other US airlines introduced service to London, they could not get rights into Heathrow, due to the treaty, and started flying into Gatiwck instead. Note that AA flies from certain cities into Heathrow (mainly those that evolve from the TW authories plus Chicago as some kind of exception was made for that route) and other cities go into Gatwick (Dallas, Raleigh, for example).
This is a difficult issue between the UK and the US, as many US airlines would prefer LHR and would like to fly into that airport.
London's third airport is now served by a CO flight from EWR, and at one time AA operated ORD-STN, but that flight was cancelled quickly due to lack of interest.