There was actually a study that showed female rats are more attracted to (read: had sex with) male rats with very different immune systems. The way she senses this is by the pheromone (smell) he gives off and as a consequence, her offspring have stronger immune systems.
In other words, this study suggests at least to some degree we don't even choose who we have sex with. Haha.