Historian Clayton Cramer writes that the founding was Christian:
Most states required you to be a Christian — sometimes specifically a Protestant — to hold public office. Some states kept these requirements as late as 1840. Many state constitutions connect religion and law: ... Massachusetts passed a 1782 law requiring church attendance: ...If this is correct, then the US Supreme Court has been interpreting the Constitution wrong for about 60 years.
Supreme Court Justice Joseph Story in 1833 explained the purpose of the “no establishment” clause in the First Amendment:
The real object of the amendment was not to countenance, much less to advance, Mahometanism, or Judaism, or infidelity, by prostrating Christianity; but to exclude all rivalry among Christian sects, and to prevent any national ecclesiastical establishment which should give to a hierarchy the exclusive patronage of the national government. -- Joseph Story, Commentaries on the Constitution 3:1688
A national establishment of religion would have been a source of continual political conflict, because no single Protestant denomination was even close to a majority. The idea that the government needed to be neutral with respect to religion vs. atheism — or even Christianity vs. other religions — would have caused some serious head scratching among the Revolution's leaders.
Based on this, it ought to be constitutional to limit immigration to Christians, or to refuse tax exemptions to mosques.