I went to a lecture this morning - the Huguenots and Religious Liberty. The Huguenots left France, went to England, came to Virginia (and other places). At the time, the Anglican Church of England was the official church (other states had their own) and ruled the roost in Virginia. At the time of the writing of the Constitution, Madison was able to get the Bill of Rights, especially the first one including religious freedom, added. The Baptists at that time were severely limited and arrested and jailed and wanted freedom to worship freely.
Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.
US Contitution