If BA could fly both planes to Haneda, they might well do - but capacity is very tight and so the second flight goes to Narita...plus, there may be onward connections or destinations other than downtown Tokyo which do make more sense from NRT than from HND - same in New York: you'd think BA would just sent all their flights to JFK given their infrastructure there, but there is clearly a market for the EWR flights - which probably isn't really about connections (since AA is primarily connected through JFK) and is more likely that EWR is much more convenient if headed to New Jersey, or in some cases the left hand side of Manhattan...