I believe when in Rome...etc. Obama did the correct thing. I would also expect him to show the same courtesy to the Queen of England and any other country where this is expected.
Just as I expect other heads of state to shake hands with our leader.
We treat all of our Presidents like we expect them to be perfect.
Get over it. None of them are.