Democrat and Republican lawmakers as well as members of the Hollywood community shunned the president’s comments.