Can a lawyer question you about your religious beliefs during a trial? I've heard that the U.S. census asking about your belief is illegal in the United States. It has been against the law since 1976 (Public Law 94-521), allegedly because collecting such information on a mandatory basis would violate the First Amendment. So I am wondering if a lawyer can ask about one's religious belief if it's relevant to the trial at hand.
The only religious matter I'm aware of that are inadmissible are for special circumstances where one's religious beliefs may be compromised if asked in court. The classic example tends to be clergymen/women being subpeonaed for information against a defendant in court. Conversation with clergy is protected in the United States and is one of a few times cops are not allowed to listen to your one phone call or visit.
The typical invocation of this would be a criminal, who confesses his sins to a Catholic priest, and may confess to a crime while receiving the Sacrament of Penance. Since Catholic Priests are bound by the "Seal of Confession" to not speak about the identity of the sinner or nature of the sin. The Priest can be excommunicated if he does this.
However, if the religion of the witness is relevant to the case (say a discrimination case) it might be prudent to inquire into the witness's religious beliefs. Suppose a major employer has a special menu in their cafeterias for Hala and Kosher observers but does not offer a fish or non-meat option for meals on Fridays in Lent, then a Catholic's belief in this practice might be called into question.
Evidence Code 789 is a good example of limits on such questions. While "[t]he credibility of a witness may be attacked or supported by any party, including the party calling him", "[e]vidence of his religious belief or lack thereof is inadmissible to attack or support the credibility of a witness". However, in Drake v. Dean, 15 C.A. 4th 915, a witness was cross-examined as to being a Jehovah's Witness, like the plaintiffs. The court found that
While one cannot be precluded from testifying because he lacks religious belief, relevant inquiry whether a witness's membership in a particular religious sect or a tenet of his faith might tend to bias him is not prohibited.
Since the doctrinal content of religions is effectively in a legal black box (courts don't decide what constitutes proper Islamic or Catholic doctrine), this limits the kinds of doctrinal questions that would be relevant. For instance, a Muslim who drinks wine could not be discredited for violating a doctrine of heir religion.