Maybe it becomes a bit iffier, though, when we think about aspects of your life that you don't have so much control over. You want to insure your house contents? You'll get charged more if it happens to be in a high crime area. You could always move to a safer neighbourhood, but maybe you can't afford to? Then there are things over which you have no control over at all. A family history of heart disease? Life insurance will cost more. You're a man? Car insurance will cost more, because men have more accidents - and ditto if you're young. You're a woman? An annuity will cost more, because women generally live longer.
That may all feel a bit unfair, but life is unfair, and insurance companies aren't out to put the world to rights, they're out to sell insurance at competitive rates, rates that will be more competitive the more precise they can be about different categories of people who face different risks.
If that was all there was to it, and the companies were totally pragmatic, I wouldn't be posting. But it seems that there are limits. For example, insurance companies won't generally make race a factor in deciding what premium to charge, even though it would surely be actuarially-significant in certain circumstances - and I wonder why not? (Possibly they might - say, if you were insuring yourself against the risk of contracting sickle-cell anaemia - but in general I think this is Not Done). If sex discrimination and age discrimination are allowed, why would racial discrimination be beyond the pale? And what else might fall into that category?
I don't have an answer or anything. I'm just curious.