The SBB site is the best site to use for trains (and other transport) in Switzerland. It is, like all rail sites, designed to get you from A to B in the shortest time. It doesn't have any route ranking for scenery.
This website gives some information on the most scenic rail routes through Switzerland: https://grandtraintour.myswitzerland.com/en/
There are other scenic lines, and most of the ones listed are going in the wrong direction for you in this case.
Here is a rail map of Switzerland: https://www.sbb.ch/content/dam/sbb/de/infotexte/uebersichtskarte-sts.pdf
I suggest you look at this while reading the below, or print it out and mark highlighter pen.
The route from Venice is : Venice - Milan - Luzern. There are 3 routes into Switzerland from the south, all via Milan. Milan is off the bottom of the map.
The quickest route, the one SBB will give by default is: Milan - Chiasso - Lugano - Bellinzona - Gotthard Base Tunnel - Arth Goldau - Luzern. The Gotthard Base Tunnel is the long dashed (- - - -) section you can see on the map. You will be "inside" the Alps, going fast but see nothing. You will see bits of the Alps before and after the tunnel.
Option 2 is using the old shorter Gotthard Tunnel. The route: Milan - Chiasso - Lugano - Bellinzona - Airolo - old Gotthard tunnel - Göschenen - Arth Goldau - Luzern. Notice the spirals on the rail line before and after the tunnel. The rail line does go round in circles to gain or loose height. You see more mountains this way, but it takes longer.
Option 3 is "going over the top". Tgis takes much longer and probably cannot be done from Venice in one day, it needs an overnight stop somewhere: Milan - along the east side of Lake Como -Tirano - over the Bernina Pass - St Moritz - Chur - and then round the north side of the Alps to Luzern.
Google for videos or pictures of the "Bernina line".
You can force the SBB website to choose whatever route you want by adding "via" locations to your search.