The reason why Ahmadinajad got the first speech was rather simply. He was the only head of state who showed up. And at those events head of states get the first place, followed by head of governments and then others like ministers or ambassadors. If there had been any other head of states he would not have gotten so much spot light, or even time to hold a speech at all...but since he knew that no one (of high enough rank) else would attend he simply used it for another propaganda coup in which each side will see itself as winner.
btw: Could anyone identify what it was the clown guys threw at him? To bad they missed.