The Mercedes ace started from pole after a breathtaking lap in qualifying and led from lights to flag in Barcelona.
Vettel was triumphant at the Monaco Grand Prix a year ago and will be desperate to prevail again as he looks to close the gap to Hamilton in the championship standings.
The British driver was able to stretch out a comfortable lead out and when Ferrari opted to stop Vettel on lap 18 for the medium tyre, Hamilton was seven seconds clear.
When Vettel made his second stop during a late virtual safety auto period, after Esteban Ocon parked up his Force India by the side of the track, it backfired and he lost places instead of gaining anything.
Hamilton, who won last time out in Azerbaijan and leads the standings by four points from Vettel, had not secured first spot on the grid since the opening race in Australia.
"I'm really, really happy", said Hamilton.
It calmed down the growing fears that Formula One was becoming a one-horse race as Mercedes spent the 2017 season continuing their dominance over the field. "We had it in the past, Shanghai was trading track position versus fresh tyres".
Lewis Hamilton took his second win in succession by dominating an eventful Spanish Grand Prix.
Ferrari, who had been very strong in qualifying for the past three races, could not quite find the improvement they needed in Q3 and Vettel did well to be within one-tenth of Hamilton.
Mexican Sergio Perez of Force India came home ninth ahead of the impressive Monegasque Charles Leclerc of Sauber.
The race started with high drama as Grosjean made an inexplicable error.
Vettel has now had to settle for a disappointing fourth place in two successive races and has lost signficant ground in the championship battle with Hamilton.
His Haas spun back across the track in a cloud of black smoke ahead of the oncoming cars -- leaving Pierre Gasly and Nico Hulkenberg with nowhere to go as they plunged into the spinning Haas machine.
All were unhurt, although Grosjean had to go to the medical centre for a precautionary check because the incident triggered the high impact alert in the auto.
"I've been racing a long time so to still have that feeling when you do have that win, and that happiness and that uplift inside (is special)", he said.
"If you look from outside it's easier, but inside the vehicle, we were going through the tyres too quick". Most of the action took place during a first-lap incident involving Romain Grosjean of Haas, Nico Hulkenberg of Renault and Pierre Gasly of Toro Rosso, forcing all three drivers to retire and prompting the deployment of the safety vehicle.