The Chameleon is trying to impersonate Obama for the inauguration, thinking (wrongly, as the story points out) that just getting sworn in will make him president. The real Obama drives up and confronts the impostor, and Spidey swings in to offer his help. Bizarrely, instead of using his spider-sense to instantly detect the impostor, the only contribution he can make is the old "ask a question only the real Obama would know" trick. And Chameleon does such a dreadful job at the impersonation that Spidey's presence isn't needed at all -- he would've been found out right away, just in casual conversation with others at the inauguration. I find it totally unbelievable that a master of disguise would do so little research into his subject.
At the end, as Spidey swings away, he thinks that Obama could've easily handled the situation without his help. And that's meant to be a compliment, but it doesn't come off that way, because it was a situation that anyone with half a brain could've effortlessly resolved.
Amusingly, in the comic, Obama delivers the oath correctly the first time. I guess the Marvel Universe chief justice isn't so prone to hypercorrection.