Hamels (17-6) surrendered just one run on five hits over seven innings, reaching the 17-win plateau for the first time in his career.
Carlos Ruiz and Nate Schierholtz each knocked in a run as the Phillies won a second straight game.
Marlins starter Nathan Eovaldi (4-13) was tagged with the loss, allowing three runs on six hits over six innings.
Carlos Lee notched the only RBI for Miami.
Ohio crash that killed two caught on camera [VIDEO]
Wisconsin business offering 'therapeutic cuddling' forced to close