Did you know…
Why doesn't a plane fly in a straight line?
Short answer
Because the shortest route over a sphere isn't a straight line on the map but a great-circle arc, which on the standard projection appears curved toward the poles. Add to that published air corridors, jet streams, restricted airspace and the requirement to stay close to alternate airports.

The Earth is a sphere and the map lies
The main reason has nothing to do with aviation: it's geometry. On a spherical surface, the shortest distance between two points is the arc of the great circle connecting them — the circle whose center coincides with the Earth's center. When that curve is drawn on a Mercator projection — the one used by almost all maps and onboard screens — it appears arched toward the nearest pole.
The classic example is Madrid–New York: the optimal route climbs toward the North Atlantic instead of crossing horizontally, making anyone looking at the map think the plane is taking a detour. The opposite is true. A flight between Europe and East Asia passes close to the Arctic for the same reason. On a globe with a taut string, the supposed detour disappears.
The air is not still
The second cause is meteorological. At cruising altitudes, jet streams flow — ribbons of wind several hundred kilometers wide where speed can exceed 200 km/h (about 110 kn) and in extreme cases double that figure. Flying within a favorable stream shortens flight time and fuel burn; flying against it increases them sharply. That's why transatlantic routes aren't symmetrical: eastbound flights seek out the jet stream, while westbound ones avoid it, and the optimal route is recalculated daily based on the forecast.
Over the North Atlantic this is organized through an oceanic route structure published twice a day and adjusted to the jet stream's position. Dispatchers also choose a cruising altitude and speed that minimize total cost, not distance, and avoid areas of turbulence, convective storms or volcanic ash, which force detours of hundreds of kilometers.
Airspace structure and safety rules
Over land the aircraft doesn't choose freely: it flies along published airways, defined by reporting points and radio aids, with flight levels assigned according to direction of travel. Each airport's standard departure and arrival procedures also impose curved paths for separation and noise reasons over populated areas. Air traffic control introduces additional deviations to maintain separation between aircraft.
Added to that are no-fly zones: airspace closed due to armed conflicts, military restrictions or overflight denials under agreements between states. Over the past decade several closures have completely redrawn entire corridors between Europe and Asia.
Finally, twin-engine flights over ocean or desert operate under ETOPS rules, which limit the maximum distance to a suitable alternate airport, expressed in minutes of flight with one engine inoperative. This requires the route to stay within certain arcs around available diversion airports, which can slightly separate it from the theoretical great circle. Modern performance-based navigation allows more direct paths than the old corridors between radio aids, but even the most direct flight possible will still appear curved on the map.
More questions

Physics of flight
Why can't a Corsair pilot apply full power when going around after a failed carrier landing?
Because at low speed and high power the Corsair would drop its left wing suddenly and with almost no warning, due to propeller torque. If the throttle was… more…

Physics of flight
What did the phrase "banking with intent to turn" mean among F-104 pilots?
It was a joke among Canadian F-104 pilots: banking the aircraft "with intent to turn" referred to its poor low-speed turning. Its sustained turn capability… more…

Julian Herzog (Website) (CC BY), vía commons Physics of flight
What is "flight envelope protection," which the A320 pioneered?
A set of limits embedded in the flight control software: it calculates the flight envelope, adds a safety margin, and blocks pilot inputs that would take the… more…

Julian Herzog (Website) (CC BY), vía commons Physics of flight
What is the A320's SHARP package for?
SHARP (SHort AiRfield Package) improves takeoff and landing performance on short runways and is designed to increase low-speed lift. It combines aerodynamic… more…

Physics of flight
What flaw sank Vought's all-metal V-141 fighter?
It wasn't a single flaw: tests showed the V-141 still flew poorly, was prone to spinning, and also suffered tail flutter, which is why it was rejected. It… more…

Physics of flight
What wind tunnel did NACA use to study the Corsair, and how big was it?
The full-scale 30- by 60-Foot Tunnel at the Langley Research Center, in Hampton, Virginia. NACA dedicated the facility on 27 May 1931 and used it to test the… more…