A 2015 campaign press release from Donald Trump, back then the leading contender to become the Republican party’s nominee for US presidential candidate, called to ban Muslims from entering the United States:
"Donald J. Trump is calling for a total and complete shutdown of Muslims entering the United States until our country's representatives can figure out what is going on."
White House press secretary Josh Earnest responded to this during an official White House press briefing:
"The Trump campaign, for months now, has had a dustbin of history-like quality to it, from the vacuous sloganeering to the outright lies to even the fake hair — the whole carnival-barker routine [...] It’s morally reprehensible, it runs counter to the Constitution and it has consequences for our national security [...] The fact is what Donald Trump said yesterday disqualifies him from serving as president"
Was Josh Earnest's statement that denying entry to the United States based solely on religion would be against the constitution correct?
And was Josh Earnest in his function as a representative of the White House allowed to criticize party nominee contenders that way?