Capitalism supports freedom of and from religion.
Capitalism is the social system that protects the individual’s freedom to live their life according to their own philosophical beliefs (whether religiously inspired or not), so long as their actions do not violate the rights of others.
Under capitalism, the state neither supports nor opposes religion, as long as those religious practices do not violate the rights of others.
Religious freedom is not a fundamental right but is a derivative of the right to life
Religious freedom is not a fundamental right but is an application of the right to life to a particular context: the freedom to form one’s own conscious beliefs and the freedom to act on those beliefs.
Such freedom is not an out-of-context absolute (anarchy) but is only an absolute within the context defined by the concept of individual rights. “A ‘right’ is a moral principle defining and sanctioning a man’s freedom of action in a social context.” [Ayn Rand, “Man’s Rights”]
Religious freedom arises because an individual has the right to act (right to life and right to liberty) in the pursuit of their self-interest (the pursuit of happiness), so long as they respect the rights of others.
Thus, an individual is free to promulgate their views (freedom of speech) — religious, scientific, political, philosophical, or otherwise — but has no right to force others to agree with them (freedom of thought) or to force them to support one’s beliefs financially (right to property). 
Politically, capitalism requires tolerance of rights-respecting religious beliefs and practices
Politically, all that the government requires of individuals in regards to the religious (or any social) practice of others is tolerance.
Tolerance is the refusal to initiate physical force (coercion) against individuals whom one does not approve.
Tolerance does not mean personal acceptance. It means one is free to not associate with such an individual: to leave them alone and to be left alone.
Thus, if a photographer does not wish to photograph a “gay wedding,” it is their inalienable right to do so (the right to free association). That this is “discriminatory” is not the issue as all decisions and acts are acts of discrimination — of making choices — from choosing a car to choosing one’s mate. There is no such thing as the “right” to force someone to photograph your wedding if they do not voluntarily agree to do so.
Capitalism bans all religious practices which violate the rights of others
A rights-respecting, capitalist country bans any religious tenant which necessitates the violation of the rights of others — from preventing women from having an abortion to stoning a woman for wearing a bikini in public — as there is no such thing as religious freedom to violate the rights of others. Under capitalism, religion does not have any privileged status. One’s religious freedom ends where the freedom of others begins.
Though the political principle of rights is based on an objective (and not religious) moral code, it is not the government’s mission to force people to be moral.  Under capitalism, individuals are free to act irrationally, against their rational self-interest — by whim, on faith, or by emotion — so long as they do not violate the rights of others.
 “The legitimate powers of government tend to such acts as are injurious to others. But it does me no injury for my neighbor to say there are twenty gods, or no God. It neither picks my pocket nor breaks my leg.” — Thomas Jefferson
 An interesting observation of this is Thomas Jefferson who in his Autobiography,
“…an amendment was proposed by inserting the words, ‘Jesus Christ … the holy author of our religion,’” which was rejected “by a great majority in proof that they meant to comprehend, within the mantle of its protection, the Jew and the Gentile, the Christian and the Mohammedan, the Hindu, and the Infidel of every denomination.”
And in the words of James Madison,
“While we assert for ourselves a freedom to embrace, to profess and to observe the religion which we believe to be of a divine origin, we cannot deny an equal freedom to those whose minds have not yet yielded to the evidence which has convinced us.”