When Paul Hamm fell on his landing, that should have been the end of his chances--he dropped down to 12th place behind some top competitors. You could see his disappointment and dejection. He could have just laid down and died at that point, but he didn't. And when Wei and Suciu faltered, possibly from becoming defensive and trying to hold on to their positions rather than going all out to win, Hamm was in a position to take advantage of it. Since he had nothing to loose by going all out, he did. His program was virtually free of mistakes and had losts of risk--the three clean releases and the stuck landing were impressive. He only won by a very narrow margin--the slightest error would have dropped him.
Sure gymnastics judging is subjective within certain guidelines, as are many other sports. That's just how it is and athletes who go into those sports know that and the smart ones work it to their advantage. If you want good examples, remember what happened in the ladies' figure skating in the '94 and '98 Winter Olympics, when energy, athleticism, flashiness, and enthusiasm won out over excellent technical performances.
As for the Koreans, sure it's disappointing to come so close and not get it, but, on the other hand, if the others had performed clean programs, they wouldn't have medaled at all.