His No. 22 McLaren-Mercedes crossed the finish line 5.478 seconds ahead of BMW's Nick Heidfeld.
The circuit's reigning rookie of the year, who started in the pole position, captured his fifth career win in a race filled with incidents.
Massa and reigning points champion Kimi Raikkonen exited with engine trouble.
The Massa-Coulthard incident also knocked out Sebastien Vettel, Mark Webber, Anthony Davidson and Giancarlo Fisichella.
"It's probably the best race I've had so far in terms of managing tires, controlling my pace and confidence and being comfortable in the car," the 23-year-old Hamilton told the BBC. (But) there are a lot of areas I can improve."
Swim Week Miami Beach 2014 [PHOTOS]