The German's third consecutive victory moves him into a six-point lead over Alonso in the championship.
Hamilton challenged Alonso for third place in Korea in the early laps but began to suffer handling problems and he was told there was a problem with the car. McLaren later said it was almost certainly a rear anti-roll bar failure.
That forced Hamilton to do an extra pit stop because of high tyre wear and his efforts to beat the Toro Rossos to eighth place foundered when he ran off the road and collected some artificial grass which further worsened the performance of his car.
Hamilton gives up on title hopes
He pointed out that it was the third consecutive race in which he had had a mechanical problem, after retiring from the lead in Singapore with a broken gearbox and suffering a broken rear damper in Japan a week ago.
His frustration with McLaren's performance was clear.
"We had another rear suspension failure somehow, I don't understand how," he said.
And in a reference to his decision to move to Mercedes next year, he added: "It's a day to forget. A year to forget as well. I'm looking forward to a fresh start next year."
Hamilton also hinted that he hoped Alonso would beat Vettel to the title.
"I hope Fernando keeps pushing," he said.
Button said his title hopes were "definitely" over after his retirement - he is 84 points behind Vettel.
"I can't really [remember a worse day in the office]," said McLaren team principal Martin Whitmarsh. "This was one of those days that I won't forget but I will be trying desperately to.
"What we have to do as a team now is say that we have a car that was desperately quick, we can go out there and still get results in these last four races.
"This team is and will be focused on getting out of here as quickly as we can and we'll focus on doing what we can to be there and fighting for victories in the last four races."
Korean Grand Prix 2012, day three
Sunday, 14 October: Race replay 14:05 BST; BBC One. Highlights 19:00 BST BBC Three.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.