While schools may need to collect information about students for various reasons (like for meal programs or to identify potential learning needs), this information must be gathered in a neutral and non-intrusive way that doesn't pry into private religious beliefs. If religious affiliation is relevant for a specific, limited, and compelling reason (e.g., for a student's request for religious accommodation), the inquiry should be carefully worded and the information treated with utmost confidentiality. Even then, the school must have a compelling justification and follow established legal procedures.
In short, while there might be extremely rare exceptions in very specific contexts, directly asking parents about their religious beliefs is generally illegal and inappropriate for public educators.