Scotland were hamstrung by the sin-binning of Edinburgh's Nick De Luca and Glasgow Warriors' Rory Lamont in the second half and their absence coincided with Halfpenny's double.
Cardiff Blues wing Alex Cuthbert got his first international try early in the second half after the first had ended 3-3 with penalties traded by Edinburgh's Greig Laidlaw and Halfpenny.
Laidlaw dived over late on to end Scotland's try drought but it should have happened at the end of the first-half when Scotland were very much in the ascendancy.
Within seconds of the second half re-starting they were on the back foot with Glasgow Warriors' Chris Cusiter conceding possession deep in their 22.
A couple of phases later Cuthbert ran in and Halfpenny added the extras to make it 10-3.
Then De Luca was sent to the sin-bin for taking out the Scarlets centre Jonathan Davies off the ball and the Halfpenny show commenced.
First he slotted a penalty then Cuthbert put him in for a 51st minute try.
When Rory Lamont joined De Luca in the bin for tackling James Hook without the ball it was only a matter of time before Wales got another and sure enough Halfpenny was the man.
This time he went over in the opposite corner after being fed by Mike Phillips.
At 27-6 the contest was over but the Scots hit back immediately with debutant Glasgow Warrior Stuart Hogg being denied a certain try for a harshly-judged knock-on.
Yet soon after Laidlaw nipped over from close range and converted to make the final score 27-13.