You bought the cheapest ticket going - a 6 berth couchette. You could have instead chosen a 4 berth, or a 1-2-3 private cabin.
Paris to Venice for example (pre covid), prices in the 6 berth couchette were €29, a 1 berth sleeper €170.
Paris to Venice for example (pre covid), prices in the 6 berth couchette were €29, a 1 berth sleeper €170.
Or you fly in the morning, early taxi (€30? €50?) to the airport, queues at the airport, then the transfer at the far end.
And of course someone else is subsidising your €170 flight via the externalities of air travel.