As with the whole selfish thing, racism's another one of those hard-programmed evolutionary things, in this case, it stopped unknown males from messing with a group's gene pool. In fact, it's genuinely helpful and encouraged amongst military folk to stop them going all teary-eyed and remorseful when it's raining lead out there.