Democrats said the speaker’s Twitter post showed that he was out of touch.