Why was Pan Am Flight 103 flying over Lockerbie? Pan Am Flight 103 was a flight from Frankfurt to Detroit with stops in London and New York.  

Why after taking off in London did it fly all the way to Lockerbie instead of going directly to New York? Take a look at these pictures.
The direct route you show is actually only a straight line on your map projection. The surface of the Earth is curved and the straight line between London Heathrow and New York JFK looks like this (courtesy of greatcirclemapper.net):


That still does not quite get you over Scotland, but the actual flight path over the Atlantic typically uses a North Atlantic Track. These are routes, which are redefined twice a day to make optimal use of the prevailing enroute winds. Here is one example for such tracks:

(image source)

The entry points to these routes can be quite high north, therefore resulting in an optimum route over Scotland.