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.
Toddler uninjured after being knocked over by Obama family dog
Gal Gadot cast as Wonder Woman for 'Batman vs. Superman'