Because it's correlated with culture and values, which are important.
I wouldn't automatically exclude any, but in some cases it would mean getting certain things ironed out before going any further. Polytheists and atheists would be examples. Those are more likely to be moral relativists, which I generally can't stand. But if they are moral absolutists, then I think it would be fascinating to discuss how they reconcile that with their beliefs.
I would need a lot more than that. I can get along with just about anyone in everyday dealings of course, but to actively seek someone's company for the sake of being in their company, a lot of stuff has to click.
So do you think it's wrong or not possible to ask someone's religion just in the hope of having an interesting discussion? Yes there will be some judgment on my part as well. But I pass judgement on people all the time (as I think a lot of people do)...this guy's dorky, that girl's sexy, there goes an asshole etc....but these are judgments relative to me, not absolute judgments. For example, the absolute label "asshole" can be rephrased to be relative, ie. "someone I'd like to punch in the nose". It's just easier to use the absolute phrasing. It doesn't mean I think of it that way deep down. I don't pass judgment on overall absolute worth, since I see that as God's territory.