Past research indicates that being religious is frequently motivated by the need to avoid uncertainty, and associated with prejudice against value‐violating groups. The present research clarifies these previous findings and shows for the first time a causal link between a sense of uncertainty and group attitudes through religiosity and the perception of the target group's mindset. Study 1 demonstrates that belief in God is associated with uncertainty avoidance, and increases prejudice against value‐violating groups, but simultaneously increases positive attitudes towards value‐consistent groups. Study 2 demonstrates experimentally that a sense of uncertainty shapes intergroup attitudes when the relationship is mediated through the belief in God, and the perception that a target group actually violated perceiver's values. The results corroborate and broaden previous findings on religiosity, ambiguity avoidance and prejudice, and for the first time show a causal link between a sense of uncertainty and attitudes towards value‐violating and value‐consistent groups.