The two sides were tied at half-time, but in the second half yellow cards gave the home side the chance and they took advantage.
Scotland pay for lack of discipline against Wales in Six Nations
Dan Lydiate, the Welsh flanker, accepted his side were the beneficiaries of Scotland's indiscipline as they recorded a 27-13 Six Nations win at the Millennium Stadium.
Leigh Halfpenny scored 22 points with two tries, three conversions and two penalties, and Alex Cuthbert scored his first international try as Wales made it two wins from two to start the tournament.
Halfpenny's first try arrived with Scotland's Nick De Luca in the sin bin for hauling down Jonathan Davies without the ball, and his second - along with a penalty - after Rory Lamont had also been yellow carded.
And man-of-the-match Lydiate, a key figure in a fine display by the Welsh pack, said: "Yellow cards are always crucial, you've got to be squeaky-clean in this day and age and everybody's got to work on their discipline."
Greig Laidlaw's try cut the deficit - he also kicked the conversion and two penalties - after Scotland debutant Stuart Hogg was denied a score when he was adjudged to have knocked on, and Wales had to hang on a man short in the closing moments after Gethin Jenkins was also sin-binned.
Andy Robinson, the Scotland coach, said his side had been punished for failing to take their chances.
"I'm proud of the way we went out and played the game," the former England flanker and coach said. "We had opportunities to score before half time and didn't and after half time we missed the restart and Wales took their opportunities," he added.