It is mostly standardized procedures.
I take as example Amsterdam airport (AMS), but the following is applicable to most, if not all, major commercial airports.
Let's look at the departure charts , in particular
this one: as you can see, if an airplane is departing via that runway, it MUST follow one of the two specified paths to exit the airspace of the airport through the "ANDIK" waypoint.
It has different paths for the other exit waypoints, but they are similarly defined and limited in number.
In the link you will find similar charts for each of the runways.
Within restrictions due to factors like terrain, noise abatement over populated areas (as Dan's mentions in his answer ), areas restricted due to security and safety (over city centres, government and military installations, nuclear power plants and such) or used for other purposes (military operations, space launch and such), these routes are defined so they don't intersect (much).
This ensures arriving and departing aircraft
don't come close to each other, which greatly reduces the risk of collision and allows responsibility for different routes to be split among several controllers who can each handle their assigned routes mostly independently of the others.
Weather conditions and other factors will dictate which runways are used, but the runway will dictate how the airplane will exit the airport's airspace, after the appropriate exit waypoint has been selected (you generally would not use a waypoint on the north side if you have to go south).
So, to summarize: you have a limited amount of exit waypoints
you have
a limited amount of runways weather will restrict your choice (well, the airport's tower will do this for you) of runway
your destination will restrict your choice of exit waypoint for each runway-waypoint pair you will have one or two possible routes
This results in the kind of behaviour you have observed.
aviation.stackexchange.com/users/1467/Federico
Aircraft are routed based on all manner of different things.
Just off the top of my head, here are some of the more common reasons: Standardised routing.
It's much easier for controllers to manage aircraft if everyone is following a similar route, and so there are generic routes defined.
This is especially true in and out of
airports - imagine
if dozens of planes were simply arriving in any direction they like, it would be very chaotic to deal with.
Noise Abatement.
Many areas have noise abatement procedures, where aircraft are either restricted from flying over or the number or flights is limited.
It's not uncommon for aircraft to have to fly around certain places.
Weather Avoidance.
For comfort and safety, aircraft will sometimes be routed around certain types of weather.
aviation.stackexchange.com/users/2160/Dan
This isn't an answer, just an addition to @federico's answer.
The following image shows departing aircraft from international airports near my location, Düsseldorf (red) and Cologne (blue).
The data was recorded over 24h from flightradar24 and put on a map together with some beacons.
The dotted lines indicate the angles mentioned below.
Looking into the departure charts for Düsseldorf , one finds for take-offs to south-west this, in layman’s words:
Turn hard right and fly away from NOR at 0° Turn right to LMA (Roughly, there are more points not shown in the map, and more than one route), then depending on destination turn
left to 203° or 209°.
Turn left and fly to NOR at 174°, then turn left to GMH at 86° Finally, there's a chart showing all this together, though this is more about noise:
For cologne it's obvious that there are similar rules.
It's also clear that the flights from Düsseldorf to south-east are guided around Cologne by flying a little towards GMH first.
So, not an answer, just to show that aircraft fly as they are intended to do, though there are a few exemptions.
aviation.stackexchange.com/users/4170/sweber
Just like you can't drive your car straight from point A to point B because there might not be a direct road between the points, aircraft can't necessarily fly from point A to point B because there might not be airways that directly connect the points.
Also, most traffic between major airports will follows established procedures.
These are either Standard Information Departure (SID) - for flights departing or Standard Terminal Arrival Route(s) (STAR or STARS), for flights arriving.
These standard departure and arrivals procedures are put in place based on the geography, weather or other restrictions at or near the airport and don't have to coincide with the flight's arrival or departure direction.
aviation.stackexchange.com/users/3363/DeepSpace
Just one clear answer why it is also done on short trips
(so not depending on the earths curvature that much): Airplanes have the allowance to fly on a flight level (FL), given in feet / 100 AND refering to an imaginary surface level where the standard pressure of 101325
Pa is located.
So FL 130 is 13000 feet above the level with 101325Pa ambient pressure.
Some turns are only allowed at that FL to avoid collisions with other airplanes.
aviation.stackexchange.com/users/15518/Scotty1-
I have seen that flights will make a turn, after traveling some large distance (say after some kilometers), but that can be done before.    Why not flying directly like in  2 ?  I am not expecting a passenger flight to do like fighter jets and perform nearly vertical take-offs, or some other manoeuvrers.   Are these flights restricted to do so, or is there any reason to behave so? Or did I misunderstand something?
Why do some flights make turns shortly after takeoff?
aviation.stackexchange.com
<airline-operations><flight-planning>
aviation.stackexchange.com/questions/29481
aviation.stackexchange.com/users/15491/NANDAKUMAR
There are a number of reasons why planes turn after take off. The ease of controlling traffic at the airport is one: aircraft take off in the same direction and then turn to follow their airway. Noise abatement is another issue, some areas cannot be flown over constantly. Planes also turn to avoid certain weather conditions. The main reason is that there are some generic routes for pilots and standardized procedures to be followed. Also, similar to driving and roads, aircraft cannot reach a certain point from another if there doesn't exist an airway connecting them. Another reason is that in many regions there are noise abatement procedures in place, restricting the possible routes or number of flights. Finally, sometimes this happens to avoid certain types of weather.
The main reason is that there are some generic routes for pilots and standardized procedures to be followed. Similar to driving and roads, aircraft cannot reach a certain point from another if there doesn't exist an airway connecting them. In many regions there are noise abatement procedures in place, restricting the possible routes or number of flights. Sometimes this happens to avoid certain types of weather.