Taqiyya. He’s allowed to do any number of ‘non-muslim’ things if it advances the cause of islam. His being president certainly advances the cause of islam. As long as he never publically renounces islam he’s golden to them.
And if enough Muslims did know that, how would they be able to keep it a secret?
Obama definitely sympathizes with Muslims, but I doubt he's a very convinced believer in any religion.