Commercial flights are given clearance from ATC to fly specific Standard Instrument Departures (SIDs). In this instance in Venizia, the pilots upon requesting clearance would have been told by ATC to fly the “Vicenza Eight X-ray” (VIC8X) departure, as shown in the purple track below.
Italia AIP - Venezia SIDs1
Your instinct is correct: SIDs are designed to be efficient, not to “waste fuel and time” as you put it.
The primary objective of the design of instrument flight procedures is
to ensure safety while taking into account efficiency and operational
considerations.
ICAO, Doc 8168, Volume I, Part I, Section 2, Chapter 1
The design of SIDs should aim to ensure the safety of aircraft
operations while also facilitating efficient air traffic management.
ICAO Annex 11, Chapter 2, General Provisions
The most important factor however in SID design is safety. Nearby terrain is one of the common big threats to commercial operations. Hence why some SIDs are designed to initially take the flight routing climbing away from the high terrain on departure. A good example of this is Bergamo, Italy - where departures to the North initially turn towards the south on departure before turning back towards the easterly side of the airport (waypoint LEGLO) and continuing enroute northwards.
Italia AIP - Bergamo SIDs1
Back to our example in Venezia, there is no immediate terrain so it does seem strange that the VIC8X SID was the cleared routing? As the Venezia charts show, a left turn after departure is an option (green track). The notes at the bottom left of the chart tell us that this departure isn't an option when there is intense military traffic present within the Treviso CTR. So the presence of military traffic would make a left turn departure unsafe due to congested airspace or perhaps limited ATC coverage, hence why the right turn was the only option available.
Terrain, other airports, airspace danger areas or restrictions are other issues of safety which may preclude the flight routing being the most efficient.
For example, London Luton departures to the east: a right turn is made and then 5000ft is maintained - all due to the proximity of London Stansted.
UK AIP - Runway 07 east departing SIDs - initial turn and altitude restrictions are highlighted in yellow
As a pilot myself, I have also had instance where a thunderstorm cell is sitting on the desired departure path, in this instance we may request a completely different routing from those published on the charts. As in many aspects of modern commercial aviation, efficiency is a high priority, but safety always precedes it as required.
Once safety implications are considered, the SID design then might take into account noise abatement. A good example of this is Barcelona, where all departures from runway 24L (southwesterly) make an immediate (quite dramatic) left turn over the sea to climb before turning back towards land. There is a good video on YouTube showing such a departure .
Spanish AIP - Barcelona 24L SIDs - initial turn highlighted in red
However, immediate noise abatement (below ~4000ft) is typically handled by operationally using NADP1 profiles and flying the initial part of the SID slowly and therefore climbing at a steeper gradient (note the "IAS MAX 200" in the Bergamo and Venezia charts).
1 Aeronautical Information Packages (AIPs) are freely available - typically online. In this instance, the Italians have provided the information via an iPad app.