The Scots conceded seven tries in the Pool B match and the defeat consigned them to second place following victories over Japan and the hosts, Russia. They will now go into the Plate competition, which they won last year.
Scotland coach Stephen Gemmell said: “We’re massively disappointed at the manner of tonight’s defeat. We put ourselves into the exact position we wanted to be in at the beginning of the South Africa game. We then lost an early try and capitulated. The challenge for everyone now is to get back up for the Plate quarter-final against Portugal. We’re the defending champions of this trophy, therefore we need to go out and show what that means to us.”
Earlier, Scotland had defeated Russia 21-5 thanks to tries by Chris Dean, Andrew Turnbull and Mark Robertson and three Colin Gregor conversions.
Defending champions Wales will play tournament favourites New Zealand in the quarter-finals of the main competition. Wales beat Fiji 19-14 to ensure they finished the group stage unbeaten, while New Zealand who, despite dominating the annual sevens series, have not been world champions since 2001, also won all three of their matches.
They were given a scare by the United States in their final pool match, however, having to come back from 19-5 down to eventually prevail 26-19.
South Africa will play Fiji, who along with France were one of the two best-placed group runners-up to progress to the quarter-finals.
France will take on Kenya and the final quarter-final will be between England and Australia.
• Former Scotland lock Scott Murray, 37, has retired from playing to focus on his role as forwards coach with French outfit Mont de Marsan.