Further penalties from Steyn and his namesake Frans Steyn gave South Africa a 13-0 half-time lead.
The Samoans held firm in the second period and were rewarded with a try when George Stowers went over.
With 10 minutes left of the game Samoa were reduced to 14 men when Paul Williams was sent off for a punching incident.
South Africa advance to the quarter-final stage as Pool D winners and are likely to face Australia in the quarter-finals, if Ireland defeat Italy in the final game of the group stage on Sunday morning.
Samoa, meanwhile, are expected to finish third in Pool D if Wales defeat Fiji on Sunday.