Several things but let's look at one in particular. Both look down on those of us who believe in God and seem to think us naive, backward or unworldly.
Marx is often quoted as saying the "religion is the opiate of the masses." (Which is a bit more poetic than what he actually said - that it "is the opium of the people.")
Obama now chimes in with his version stating that in "small towns" in Pennsylvania and in the Midwest, folks have fallen on tough times so "they get bitter, they cling to guns or religion or antipathy to people who aren't like them or anti-immigrant sentiment or anti-trade sentiment as a way to explain their frustrations."
Let's skip the anti-gun and pro-illegal-immigration hints and focus on the religion comment for now. Obama looks down his nose at "the masses" in small towns (as opposed to him the worldly and knowledgeable big-city-dweller) and says that those people need to cling to religion just like it was their opium.
In reality is a real and vital part of the human existence in small towns, big cities and everywhere else on this planet. It is not an escape or a drug. Religion is reality. Since he claims to be a Christian, Obama ought to know that. Unfortunately, it seems, he doesn't understand.