If you read what he said, you can see he did not literally agree with him. He did not challenge Sarkozy, but made a bland statement in reply.
I am sure it is true that Sarkozy is fed up with Netanyahu, and it is also true that Obama has to deal with Netanyahu more than Sarkozy does. That is a truism from a politician who doesn’t want to make any sort of committed statement, and is typical of Obama.
It's part and parcel of his "Present" status quo.