The right-wing scored a try in each half as the Springboks overcame a slow start to lead 32-9 at half-time and the red carding of Samoa left-wing Alesana Tuilagi for a stiff-arm tackle on the hour mark ended the game as a contest.
However, Habana saw his hopes of a hat-trick dashed 10 minutes from time when he deliberately knocked on as Samoa threatened to score and spent the rest of the match in the sin bin.
“We are heading in the right direction and were much better than last week,” South Africa centre and captain Jean de Villiers said seven days after an unconvincing win over Scotland.
“It was a very tough match and I am very proud of the team. There will be a lot of sore bodies tomorrow morning after a great effort against a special Samoan side.”
Samoa captain and centre Paul Williams said: “Our lack of discipline let us down badly — we were on the wrong side of the penalty count. It was a humbling experience against a great Springbok team.”
Springboks fly-half Morne Steyn had a couple of early penalty chances and after planting the first between the posts, the other drifted just left.
Full-back James So’oialo levelled with his first kick at goal and Samoa were unlucky not to go ahead when a brilliant break by fly-half Tusi Pisi was thwarted by a try-saving tackle from scrum-half Ruan Pienaar.
Another So’oialo penalty nudged the Pacific islanders in front only for the Springboks to hit back soon after with Habana claiming the first of four first-half tries.
South Africa kicked two penalties to the corner, won the resulting line-outs and, when the ball sped along the backline, full-back Willie le Roux was up to send Habana over.
Steyn converted and also added the extra points after flanker and official man of the match Francois Louw touched down as Samoa proved helpless when South Africa launched one of their potent weapons — the driving maul.
The loss of centre Johnny Leota with concussion and tight-head prop Logovi’i Mulipola to the sin bin did not help the visitors and the home side took advantage.
Steyn landed a penalty, but failed to convert a try by centre JJ Engelbrecht, who shrugged off several less-than-convincing tackles to touch down for his second of the tournament.
So’oialo slotted a third penalty off a rare visit to the green-and-gold half, but South Africa struck again with left-wing Bjorn Basson going over in the corner and Steyn converted for a 23-point half-time advantage.
Samoa started the second half desperate for points and got them within seven minutes when good ball retention off a tap penalty allowed lock Filo Paulo to go over and So’oialo converted.
The full-back had a let-off soon after when, with the crowd baying for a yellow card, he got away with a warning from the French referee for using his hands in an “indecent manner” when grabbing hooker Adriaan Strauss.
“Off, off, off” chanted the crowd within minutes as De Villiers was the victim of a dangerous tackle by giant Tuilagi, who was red carded after the referee consulted the television match official.
Worse was to follow for the islanders as South Africa won a line-out, set up a maul, and Pienaar darted for the line before sending Habana over in the corner Tuilagi should have been guarding.
A man down on the field and 37-6 down on the scoreboard with a quarter of the Test to go, Samoa knew the game was up and Steyn, Louw and replacement prop Trevor Nyakane added tries, two of which substitute Patrick Lambie converted.
There was one crumb of comfort for the Samoans as a clever line-out manoeuvre led to replacement forward Junior Poluleuligaga scoring a try that Williams converted.