Agreed. I've long thought that it's much more the case that a person's religion is a function of their values, not the other way around.
Or, put another way, if a person's religion conflicts with their values (including prejudices), which one is more likely to give first?