You can't compare one-year production in this scenario, because not only was Masterson injured (and this is common knowledger) but Porcello greatly outpitched his peripherals last year, which were similar to the rest of his 4.30 ERA career.
Compare the three years prior to 2014 for both pitchers:
Porcello average : 178 IP, 4.56 ERA, 96 ERA+, 1.4 (!) WHIP, 5.9 K/9.
Masterson average: 205 IP, 3.85 ERA, 100 ERA+, 1.3 WHIP, 7.5 K/9.
So you're basically looking at two league-average pitchers, but one is only going to cost you money and people in the industry believe he's bound to bounce back to his pre-injury performance since he has no arm-related issues.
I'm also not buying Porcello to the Red Sox because his peripherals just aren't that good.