This incident has been addressed elsewhere in this section (can't recall where).
Anyway, Carter wasn't doing what Trump is proposing. That freeze was not based on religion, as Trump's is. It was based on them being the citizens of a sovereign nation, the government of which we were in conflict with.
They were not unconstitutional, they were standard measures taken at a time of diplomatic crisis between nation states.