Galmarini claimed victory by 0.43 seconds from local favourite Lee, who claimed his country's first ever medal in a snowboard event, as Slovenia's Zan Kosir defeated Sylvain Dufour of France in the small final to complete the podium.
Galmarini finished second to Russia's Vic Wild in Sochi four years ago but the Swiss had enough in the tank this time to overcome a local rider when he defeated Lee in the final.
Morgan partied like a champion and now carries the British flag
Lee's semi-final win over Kosir, guaranteeing the hosts a first ever Olympic snowboarding medal, was greeted by huge cheers from the crowd, who had turned up in huge numbers for the last day of action at Phoenix Snow Park.
Kosir matched his bronze medal from Sochi with victory over Dufour, who struggled to maintain the speed that had carried him into the semi-finals.